pre-defined-discriminator-mapping-value-schema
Overview
This rule belongs to the openapi-v3-apimatic-linting
ruleset and states that:
In OpenAPI specifications, when using a discriminator to distinguish between different schemas, each schema must be defined in the specification. Each schema referenced in the discriminator mapping must be defined in the specification to ensure that the schema is properly defined and can be used correctly.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Schema referenced/used in discriminator mapping value is undefined. |
Code | OPENAPI3APIMATIC_L805 |
Type | Linting |
Rule System | Semantic |
Broad Category | OpenAPI Discriminators |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi apimatic semantic linting discriminator mapping value resolvable valid schema |
Suggested Fixes
- Check the OpenAPI specification to confirm if any schema referenced in the discriminator mapping is undefined.
- If any schema referenced in the discriminator mapping is undefined, define the schema in the specification.