instrumenta / openapi2jsonschema

Convert OpenAPI definitions into JSON schemas for all types in the API
Other
226 stars 87 forks source link

Add option to generate schemas for request and response bodies #25

Open zeusttu opened 5 years ago

zeusttu commented 5 years ago

Currently JSON-Schemas are only generated for definitions in the definitions or components/schemas section. This is alright if your full request and response bodies are defined there, but that is not always the case in every OpenAPI spec. It would be nice if paths/<path>/<httpmethod>/requestBody/content/<mimetype>/schema> and paths/<path>/<httpmethod>/responses/<httpcode>/content/<mimetype>/schema> could also be traversed.

The generated filenames will probably be long and ugly, but that is something I can live with.