zally
zally copied to clipboard
Discriminator property is not validated
Related with #321
Accordingly with the OpenAPI spec when you define a discriminator the name should be in the schema and must be required:
discriminator | string | Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. The property name used MUST be defined at this schema and it MUST be in the
required
property list. When used, the value MUST be the name of this schema or any schema that inherits it.
Should this trigger a parse error?
Acceptance criteria
- [ ] The property name used MUST be defined at this schema
- [ ] The property name used MUST be required
- [ ] Violation error should be shown
This is a great candidate for a Zally Check! Feel free to propose a corresponding change to the API Guidelines.