use of org.raml.jaxrs.generator.GFinderListener in project raml-for-jax-rs by mulesoft-labs.
the class TypeUtilsTest method finder.
private Map<String, GType> finder(String raml) {
RamlModelResult ramlModelResult = new RamlModelBuilder().buildApi(new InputStreamReader(this.getClass().getResourceAsStream(raml)), ".");
if (ramlModelResult.hasErrors()) {
for (ValidationResult validationResult : ramlModelResult.getValidationResults()) {
System.out.println(validationResult.getMessage());
}
throw new AssertionError();
} else {
final Map<String, GType> decls = new HashMap<>();
new V10Finder(null, ramlModelResult.getApiV10()).findTypes(new GFinderListener() {
@Override
public void newTypeDeclaration(GType type) {
decls.put(type.name(), type);
}
});
return decls;
}
}
Aggregations