-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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: otherSchemaThis 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