-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Closed
Labels
Description
As discussed on the TSC on March 25th, discriminator
is supposed to not affect JSON Schema validation.
https://github.com/OAI/OpenAPI-Specification/blame/master/versions/3.1.0.md#L2703
and the following examples puzzle me here, as to me it clearly reads that properties
/required
in combination with polymorphic use of allOf
are to be ignored, if they are not on a nested object definition underneath allOf
themselves
foo
required with otherSchema
carrying the discriminator
:
allOf:
- $ref: otherSchema
- type: object
properties:
foo:
type: string
required: ["foo"]
foo
ignored/not required:
properties:
foo:
type: string
required: ["foo"]
allOf:
- $ref: otherSchema
This to me is not compatible with the intention to have discriminator
to only be a hint.
https://github.com/OAI/OpenAPI-Specification/blame/master/versions/3.1.0.md#L2701 also specifically lists deserialization, serialization and validation