-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Labels
Milestone
Description
If you create a schema with definitions that include a discriminator, you will get a false warning that some models are not in use. In fact, they may be in use indirectly.
For example:
Animal:
type: object
discriminator: petType
properties:
commonName:
type: string
Cat:
allOf:
- $ref: '#/definitions/Animal'
- type: object
properties:
isFurry:
type: boolean
default: falseWill give a warning like such:
It can be difficult to decide what may be referenced by a discriminator, I believe we can encapsulate it in a fairly simple rule:
- If a schema contains the
discriminatorfield, AND that schema is referenced in anallOfconstruct, AND neither models are inline schemas, we should ignore any warnings that theallOfmodel is unused.
Reactions are currently unavailable
