pre-defined-schema-property-for-discriminator
Overview
This rule belongs to the swagger-v2-standards-validation
ruleset and states that:
The name specified for the discriminator in the Schema Object must correspond with a schema property definition in the properties of the schema object it is part of.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | The discriminator property name does not exist in the schema properties. |
Code | SWAGGER20STANDARDS_V315 |
Type | Validation |
Rule System | Semantic |
Broad Category | Schemas |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | swagger2 swagger standards semantic validation discriminator name schema schema object properties property |
Suggested Fixes
- Add a definition for the property under the
properties
property of the Schema Object if you haven't added already. - Make sure that the name assigned to the discriminator in the Schema Object matches exactly with the name of one of the properties defined under the same Schema Object. Names are compared in a case-sensitive manner.