Implementing enus is jsonschema utilities

This commit is contained in:
2023-03-17 17:39:20 +01:00
parent 0b9d5d42cb
commit f3f0ddc004

View File

@@ -162,6 +162,14 @@ export class JsonschemasService {
}
return false;
}
} else if (this.is_enum(resource)) {
for (const ref of resource.allOf!) {
// @ts-ignore
if (this.has_descendant(ref, property_name)) {
return true;
}
return false;
}
}
throw new Error("Jsonschema format not implemented in property finder");
return false;
@@ -186,6 +194,14 @@ export class JsonschemasService {
return this.get_descendant(ref, property_name);
}
}
} else if (this.is_enum(resource)) {
for (const ref of resource.allOf!) {
// @ts-ignore
if (this.has_descendant(ref, property_name)) {
// @ts-ignore
return this.get_descendant(ref, property_name);
}
}
}
throw new Error("property not found or Jsonschema format not implemented");
}