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
As discussed on the TSC on March 25th,
discriminatoris 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/requiredin combination with polymorphic use ofallOfare to be ignored, if they are not on a nested object definition underneathallOfthemselvesfoorequired withotherSchemacarrying thediscriminator:fooignored/not required:This to me is not compatible with the intention to have
discriminatorto 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