use of io.swagger.models.apideclaration.Operation in project swagger-parser by swagger-api.
the class ApiDeclarationParser method readApis.
List<Api> readApis(List<Map<String, Object>> om, MessageBuilder messages) {
List<Api> output = new ArrayList<Api>();
for (Map<String, Object> o : om) {
Api op = new Api();
String path = readString(o.get("path"));
if (path != null) {
op.setPath(path);
} else {
messages.append(new Message("ApiDeclaration.apis", "path is missing", Severity.ERROR));
}
Object operations = o.get("operations");
if (operations instanceof List) {
List<Operation> ops = readOperations((List<Map<String, Object>>) operations, messages);
op.setOperations(ops);
}
output.add(op);
}
return output;
}