Skip to content

Clarification on discriminator usage on allOf schemas. #3424

@iglosiggio

Description

@iglosiggio

Hi, the spec says:

The discriminator object is legal only when using one of the composite keywords oneOf, anyOf, allOf.

What's the meaning behind something like this?

components:
  schemas:
    Cat:
      allOf:
      - $ref: '#/components/schemas/Pet'
      - $ref: '#/components/schemas/Furry'
      - $ref: '#/components/schemas/Cute'
      discriminator:
        propertyName: "petType"
    # ... descriptions of other schemas

I don't see an obvious intepretation for an schema that has both discriminator and allOf.

Metadata

Metadata

Assignees

Labels

clarificationrequests to clarify, but not change, part of the specdiscriminator

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions