OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
[x] Have you provided a full/minimal spec to reproduce the issue?
[x] What's the version of OpenAPI Generator used?
[x] Have you search for related issues/PRs?
[x] What's the actual output vs expected output?
[ ] [Optional] Bounty to sponsor the fix (example)
Description
When generating code for python-flask, the generated YAML spec does not include types for nested components. Unclear if this generation problem is specific to python-flask (seems to be a more generic issue with YAML generation), but it causes automatic validation to fail when passing these types to the Flask server in a request.
Notice that the generated Parent_child component has no type. This causes it to fail with Body property 'child' not defined in body schema when passing a Parent object via request body.
Adding type: object to the Parent_child definition causes things to work properly.
Bug Report Checklist
Description
When generating code for python-flask, the generated YAML spec does not include types for nested components. Unclear if this generation problem is specific to python-flask (seems to be a more generic issue with YAML generation), but it causes automatic validation to fail when passing these types to the Flask server in a request.
openapi-generator version
4.0.0-beta
OpenAPI declaration file content or url
Command line used for generation
Steps to reproduce
After running the generator command, the generated file
gen/openapi_server/openapi/openapi.yaml
contains these component definitions:Notice that the generated
Parent_child
component has no type. This causes it to fail withBody property 'child' not defined in body schema
when passing aParent
object via request body.Adding
type: object
to theParent_child
definition causes things to work properly.