flasgger
flasgger copied to clipboard
Allow OpenAPI 3 "schemas" specification in docstrings (like "definitions" on Swagger 2.0)
One nice thing with flasgger and Swagger 2.0 when using docstrings is that you can specify any definitions (mostly) specific to one route/path alongside its responses and parameters that may use those.
With OpenAPI 3, those definitions moved to components/schemas, but it would be great to still specify them in the docstrings of the various routes/paths. There could be a schemas entry that we specify there and that gets merged up to components/schemas just like definitions is for 2.0.
Also running into something similar. Too many dependencies on definitions which is no longer present in OAS3.
For instance, utils.get_specs contains an explicit case:
...
swag['definitions'] = definition