Skip to main content

required-string-type-for-discriminator-schema-property

Overview

This rule belongs to the openapi-v3-apimatic-linting ruleset and states that:

The discriminator property is used to differentiate between different subtypes within a schema. This discriminator property, used for polymorphism, must be of type string.

PropertyValue
EnabledYes
Maximum SeverityError
MessageThe type of the discriminator property defined in the schema must be of type string.
CodeOPENAPI3APIMATIC_L702
TypeLinting
Rule SystemSemantic
Broad CategoryOpenAPI Schemas
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 openapi apimatic semantic linting string type property schema discriminator

Suggested Fixes

  • Make sure that the discrimintator property exists in the schema object.
  • Make sure that the type of the discriminator property is set to string.

For More Information