pre-defined-schema-property-for-discriminator
Overview
This rule belongs to the openapi-v3-apimatic-linting
ruleset and states that:
The discriminator property (indicated by propertyName) should either be defined directly in the same schema in which discriminator is used or be defined in oneOf/anyOf options.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | The property used as a discriminator is not defined in the schema. |
Code | OPENAPI3APIMATIC_L801 |
Type | Linting |
Rule System | Semantic |
Broad Category | OpenAPI Discriminators |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi apimatic semantic linting empty discriminator property name |
Suggested Fixes
- Provide a non-empty value for the discriminator property name that should also exist in the schema properties.