Take the following #definition from the pet store example. Given a #definition section a JSON structure can be generated
e.g.
Is there something that can do
You can use this JSON-to-OpenAPI schema converter:
https://roger13.github.io/SwagDefGen/
(GitHub project)
I haven't used it personally though, so I'm not sure how good it is.
Since OpenAPI uses a subset of JSON Schema, you could also use one of the JSON Schema generators, however you may need to manually tweak the generated definition to make it OpenAPI-compatible.
1 - Paste a response in http://www.mocky.io and get a link to your response
2 - Go to https://inspector.swagger.io/ and make a call to your example response
3 - Select the call from "History" and click "Create API definition"
4 - The swagger definition will be available at https://app.swaggerhub.com/
This works for me:
Generate Swagger REST-client code (and POJO) from sample JSON:
Go to apistudio.io:
Go to editor.swagger.io: