We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Same as #7414, but with python-flask.
oneOf or anyOf elements cause invalid python code generated.
Traceback (most recent call last): File "/usr/local/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, [...] File "/usr/src/app/openapi_server/controllers/default_controller.py", line 4, in <module> from openapi_server.models.one_of_cat_dog import OneOfCatDog # noqa: E501 ModuleNotFoundError: No module named 'openapi_server.models.one_of_cat_dog'
4.3.1
openapi: "3.0.2" info: version: 1.0.0 title: Polymorphism paths: /pets: post: requestBody: content: application/json: schema: oneOf: - $ref: '#/components/schemas/Cat' - $ref: '#/components/schemas/Dog' discriminator: propertyName: pet_type responses: '200': description: created components: schemas: # Parent Pet: type: object required: - pet_type properties: pet_type: type: string eats: type: string discriminator: propertyName: pet_type # Child 1 Dog: allOf: - $ref: '#/components/schemas/Pet' - type: object # all other properties specific to a `Dog` properties: bark: type: boolean # Child 2 Cat: allOf: - $ref: '#/components/schemas/Pet' - type: object # all other properties specific to a `Cat` properties: climbs: type: boolean
docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli:v4.3.1 generate --input-spec /local/openapi.yaml --generator-name python-flask --output /local
docker build -t openapi_server .
docker run -p 8080:8080 openapi_server
#6815 #5565 #7789
Thanks!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
Same as #7414, but with python-flask.
oneOf or anyOf elements cause invalid python code generated.
openapi-generator version
4.3.1
OpenAPI declaration file content or url
Generation Details
docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli:v4.3.1 generate --input-spec /local/openapi.yaml --generator-name python-flask --output /local
Steps to reproduce
docker build -t openapi_server .
docker run -p 8080:8080 openapi_server
Related issues/PRs
#6815
#5565
#7789
Thanks!
The text was updated successfully, but these errors were encountered: