Refactor duplicated codes
@@ -126,15 +126,13 @@ public class SwaggerConverter implements SwaggerParserExtension {
return null;
}
+ SwaggerParseResult output = new SwaggerParseResult().messages(parse.getMessages());
+
if (parse.getSwagger() == null) {
- return new SwaggerParseResult()
- .messages(parse.getMessages());
+ return output;
}
OpenAPI openAPI = new OpenAPI();
- SwaggerParseResult output = new SwaggerParseResult();
- output.setMessages(parse.getMessages());
-
SwaggerInventory inventory = new SwaggerInventory().process(parse.getSwagger());
Swagger swagger = parse.getSwagger();
