Skip to main content

required-discriminator-value

Overview

This rule belongs to the apimatic-preliminary-validation ruleset and states that:

A model containing a discriminator in its type hierarchy must have a discriminator value set in its definition.

PropertyValue
EnabledYes
Maximum SeverityError
MessageThe discriminator value for model is missing.
CodeAPIMATICPRE_V508
TypeValidation
Rule SystemSemantic
Broad CategoryGlobal Types/Models
Products ImpactedCode Generation, Developer Experience Portal, API Transformer
Tagspreliminary checks validation apimatic discriminator value discriminator base type inheritance type custom type model complex model

Suggested Fixes

  • Set the discriminator value of the model.
  • The discriminator value must be non-null and non-empty.
  • Set the base type as null if you do not want the model to belong to the type hierarchy.

For More Information