use of org.mule.metadata.json.api.JsonTypeLoader in project mule by mulesoft.
the class CustomStaticTypeDeclarationEnricher method getJsonType.
private Optional<MetadataType> getJsonType(String schema) {
String schemaContent = IOUtils.toString(getSchemaContent(schema));
Optional<MetadataType> type = new JsonTypeLoader(schemaContent).load(null);
if (!type.isPresent()) {
throw new IllegalArgumentException("Could not load type from Json schema [" + schema + "]");
}
return type;
}
Aggregations