required-discriminator-property-name
Overview
This rule belongs to the openapi-v3-standards-validation
ruleset and states that:
The Discriminator Object must specify the name of the property in the payload that will hold the discriminator value, using the propertyName
property.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Required property propertyName in Discriminator Object is missing. |
Code | OPENAPI3STANDARDS_V400 |
Type | Validation |
Rule System | Semantic |
Broad Category | Discriminators |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi standards semantic validation name discriminator property discriminator property |
Suggested Fixes
- Add missing
propertyName
property in the Discriminator Object. - Make sure that the
propertyName
property is not null or empty.
For More Information
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#discriminator-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#discriminator-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-specification
- https://docs.apimatic.io/rulesets/overview/