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

No out-of-the-box methods to serialize SwaggerParseResult back into JSON

Open NadChel opened this issue 1 year ago • 1 comments

I discovered that OpenAPIV3Parser provides methods to deserialize Open API doc JSON, but doesn't allow to serialize it back. If, for example, I need to make a deep copy of SwaggerParseResult, I can't serialize it back into a JSON and then create a new SwaggerParseResult by deserializing that JSON. In fact, I'm not sure what the official guideline is for recovering the original JSON from SwaggerParseResult (suppose I don't store it in memory)

Please consider providing out-of-the-box methods to serialize SwaggerParseResult back into JSON

NadChel avatar Dec 30 '23 14:12 NadChel

I found the methods to serialize back to yaml or json in the SwaggerParser class output = Yaml.pretty(result.getOpenAPI());

mfrappier1 avatar Feb 07 '24 13:02 mfrappier1