-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Closed
Labels
Client: PythonInline Schema HandlingSchema contains a complex schema in items/additionalProperties/allOf/oneOf/anyOfSchema contains a complex schema in items/additionalProperties/allOf/oneOf/anyOfIssue: Bug
Description
Bug Report Checklist
- [] Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator (example)?
- What's the version of OpenAPI Generator used? latest master
- Have you search for related issues/PRs?
- What's the actual output vs expected output? error during result parsing from server
- [Optional] Bounty to sponsor the fix (example)
Description
If openapi definition contains model of type array with anyOf items description, generated Python client can't parse request from server. Generated model has openapi_types with next type list[AnyOfFirstSecondThird]. During response parsing client takes one by one list items and try to de-serialize to non existing type klass AnyOfFirstSecondThird. Parsing fails at klass = getattr(openapi_client.models, klass) line with next error - module 'openapi_client.models' has no attribute 'AnyOfFirstSecondThird'
openapi-generator version
latest master, 5.0.0-SNAPSHOT
OpenAPI declaration file content or url
ContainerList:
type: array
items:
anyOf:
- $ref: "#/components/schemas/FirstResultType"
- $ref: "#/components/schemas/SecondResultType"
- $ref: "#/components/schemas/ThirdResultType"Command line used for generation
docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli generate -i /local/docs/openapi.yml -g python -o /local/clients/pythonSteps to reproduce
Related issues/PRs
Suggest a fix
Metadata
Metadata
Assignees
Labels
Client: PythonInline Schema HandlingSchema contains a complex schema in items/additionalProperties/allOf/oneOf/anyOfSchema contains a complex schema in items/additionalProperties/allOf/oneOf/anyOfIssue: Bug