swagger-parser icon indicating copy to clipboard operation
swagger-parser copied to clipboard

SwaggerParse Results need to refactor

Open sagartib opened this issue 1 year ago • 1 comments

SwaggerParseResults.. should show what are the warnings and errors, by some prefix or separate list like in ParseRoot..

Please help to fix.

sagartib avatar May 10 '24 22:05 sagartib

SwaggerParseResult giving merged results of Warnings and Error. there is no way can clearly separate from this list.

public SwaggerParseResult deserialize(JsonNode rootNode, String path) { SwaggerParseResult result = new SwaggerParseResult(); ParseResult rootParse = new ParseResult(); OpenAPI api = this.parseRoot(rootNode, rootParse, path); result.setOpenAPI(api); result.setMessages(rootParse.getMessages()); return result; }

However required results available in OpenAPIDeserializer- ParseResult,, which is protected.

if SwaggerParseResult output gives or other way to get warnings and errors separately, that would be helpful.. People can use them whether the swagger is valid or not.

or

allow them ParseOption to disable warnings and just return errors.

sagartib avatar May 10 '24 22:05 sagartib