-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Closed
Labels
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?
- Have you search for related issues/PRs?
- What's the actual output vs expected output?
- [Optional] Bounty to sponsor the fix (example)
Description
When defining the below Apple.. and Banana.. oneOf models, the discriminator in FruitRequiredDesc model does not include the mapping to the children, even though they contain the required fruitType property
openapi-generator version
latest master branch
OpenAPI declaration file content or url
FruitType:
properties:
fruitType:
type: string
required:
- fruitType
FruitRequiredDesc:
oneOf:
- $ref: '#/components/schemas/AppleRequiredDesc'
- $ref: '#/components/schemas/BananaRequiredDesc'
discriminator:
propertyName: fruitType
AppleRequiredDesc:
type: object
required:
- seeds
properties:
seeds:
type: integer
allOf:
- $ref: '#/components/schemas/FruitType'
BananaRequiredDesc:
type: object
required:
- length
properties:
length:
type: integer
allOf:
- $ref: '#/components/schemas/FruitType'
Command line used for generation
generate any client with the above input spec
specifically I am working in python
Steps to reproduce
generate any client with the above input spec
inspect the discriminator map and notice that it is empty
Related issues/PRs
Suggest a fix
I will work on one
Reactions are currently unavailable