flasgger icon indicating copy to clipboard operation
flasgger copied to clipboard

Allow OpenAPI 3 "schemas" specification in docstrings (like "definitions" on Swagger 2.0)

Open KaiRo-at opened this issue 4 years ago • 1 comments

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.

KaiRo-at avatar Dec 02 '20 17:12 KaiRo-at

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

codectl avatar Apr 25 '21 12:04 codectl