Adding enum type to json resource builder
This commit is contained in:
@@ -43,6 +43,10 @@ export class JsonschemasService {
|
||||
for (let i in prop.oneOf) {
|
||||
this.resolveReference(resource, prop.oneOf[i]);
|
||||
}
|
||||
} else if (this.is_enum(prop)) {
|
||||
for (let i in prop.allOf) {
|
||||
this.resolveReference(resource, prop.allOf[i]);
|
||||
}
|
||||
} else if (this.is_array(prop) && this.is_reference(prop.items)) {
|
||||
this.resolveReference(resource, prop.items);
|
||||
}
|
||||
@@ -112,6 +116,10 @@ export class JsonschemasService {
|
||||
return prop.hasOwnProperty('oneOf');
|
||||
}
|
||||
|
||||
private is_enum(prop: any) {
|
||||
return prop.hasOwnProperty('allOf');
|
||||
}
|
||||
|
||||
private get_reference_name(prop: any) {
|
||||
return prop['$ref'].substring(prop['$ref'].lastIndexOf('/')+1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user