Suppose I have an object of class io.swagger.models.Swagger, from the library io.swagger:swagger-models:1.5.24. How do I transform it into JSON?
My goal is to create a json file from our REST API definition. We're using Finch/Finagle in Scala, and this will be a brand new capability; I'd like it to be as generic as possible. I have an idea for the design, but it requires turning the Java model into JSON, and I haven't found that facility in Swagger yet.
This is swagger v2. Don't know what version of OpenAPI it is. It would be appreciated if there was also a method for generating swagger v3 and the related OpenAPI, but swagger v2 is an absolute necessity here.