You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Report an error when the discriminator property is not defined in 'oneOf' the schema types? #344
Should we report an error when the discriminator property is not defined in 'oneOf' the schema types? in the below example, pet2 doesn't have the expected discriminator property.
changed the title [-]Should we report an error when the discriminator property is not defined in 'oneOf' the schema types?[/-][+]Report an error when the discriminator property is not defined in 'oneOf' the schema types?[/+]on Nov 8, 2018
"... As such, the discriminator field MUST be a required field. There are are two ways to define the value of a discriminator for an inheriting instance."
Activity
[-]Should we report an error when the discriminator property is not defined in 'oneOf' the schema types?[/-][+]Report an error when the discriminator property is not defined in 'oneOf' the schema types?[/+]PerthCharern commentedon Nov 8, 2018
From the spec, we might be able to be even stricter:
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#composition-and-inheritance-polymorphism
"... As such, the discriminator field MUST be a required field. There are are two ways to define the value of a discriminator for an inheriting instance."
Would you like to send out a PR? :)
senthilkumarmohan commentedon Nov 9, 2018
Thanks for your response. I am working on it - will submit a PR soon.
fixes#344 - Report error when OneOf/AnyOf schemas doesnt have the dis…
senthilkumarmohan commentedon Nov 15, 2018
PerthCharern, i have submitted a PR for this. Please can you review?
Merge pull request #346 from senthilkumarmohan/bugfix#344-Report-erro…