Skip to main content

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.

PropertyValue
EnabledYes
Maximum SeverityError
MessageThe property used as a discriminator is not defined in the schema.
CodeOPENAPI3APIMATIC_L801
TypeLinting
Rule SystemSemantic
Broad CategoryOpenAPI Discriminators
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 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.

For More Information