Skip to main content

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.

PropertyValue
EnabledYes
Maximum SeverityError
MessageSchema referenced/used in discriminator mapping value is undefined.
CodeOPENAPI3APIMATIC_L805
TypeLinting
Rule SystemSemantic
Broad CategoryOpenAPI Discriminators
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 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.

For More Information