Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
zeusttu opened this issue May 3, 2019 · 0 comments · May be fixed by #26
Open

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

zeusttu opened this issue May 3, 2019 · 0 comments · May be fixed by #26

Comments

@zeusttu
Copy link

zeusttu commented May 3, 2019

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.

zeusttu added a commit to zeusttu/openapi2jsonschema that referenced this issue May 3, 2019
Include schemas from:

paths/<path>/<httpmethod>/requestBody/content/<mimetype>/schema
paths/<path>/<httpmethod>/responses/<httpcode>/content/<mimetype>/schema

Closes instrumenta#25
@zeusttu zeusttu linked a pull request May 3, 2019 that will close this issue
lirik90 pushed a commit to lirik90/swagger2jsonschema that referenced this issue Apr 1, 2024
Include schemas from:

paths/<path>/<httpmethod>/requestBody/content/<mimetype>/schema
paths/<path>/<httpmethod>/responses/<httpcode>/content/<mimetype>/schema

Closes instrumenta#25

Do not downcase filenames

Closes instrumenta#20

Move new functionality to separate function

Make "content" key in body definition optional

This was committed as a GitHub review suggestion.
Commit message suggested by Github:

Update openapi2jsonschema/util.py

Co-authored-by: Adam Kitain <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant