datamodel-code-generator
datamodel-code-generator copied to clipboard
Add `requestBodies` option to `--openapi-scopes`
Is your feature request related to a problem? Please describe.
I would like to document request bodies in OpenAPI's dedicated #/components/requestBodies section, however, it is not currently picked up by datamodel-codegen. See openapi doc on describing request bodies.
Describe the solution you'd like
Add a requestBodies option to the --openapi-scopes CLI arg, and generate the objects defined therein
Describe alternatives you've considered
Using the schemas section, but for large and complex API, it helps with readability to have one dedicated section to requestBodies
Hi @dflantz
--openapi-scopes paths supports parsing requestBody
Could you please try it?
@koxudaxi
datamodel-codegen: error: argument --openapi-scopes: invalid choice: 'requestBodies' (choose from 'schemas', 'paths')
datamodel-codegen --version
0.14.0
@mayn
You should do datamodel-codegen --input inputfile.yaml --openapi-scopes paths
no response :(