use of com.devonfw.cobigen.openapiplugin.model.OpenAPIFile in project cobigen by devonfw.
the class OpenAPIInputReader method getInputObjects.
@Override
public List<Object> getInputObjects(Object input, Charset inputCharset) {
List<Object> inputs = new LinkedList<>();
List<Path> paths = new LinkedList<>();
if (input instanceof OpenAPIFile) {
OpenApi3 astOpenApi = ((OpenAPIFile) input).getAST();
inputs.addAll(extractComponents(astOpenApi));
for (String key : astOpenApi.getPaths().keySet()) {
Path path = astOpenApi.getPaths().get(key);
paths.add(path);
}
inputs.addAll(extractComponentsFromPaths(paths, astOpenApi));
List<EntityDef> entityDefs = new ArrayList<>();
for (Object obj : inputs) {
if (obj instanceof EntityDef) {
entityDefs.add((EntityDef) obj);
}
}
for (EntityDef entityDef : entityDefs) {
entityDef.setAllEntityDefs(entityDefs);
}
}
return inputs;
}
Aggregations