Skip to main content

required-discriminator-with-discriminator-mapping

Overview

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

Discriminator mapping values indicate possible values that a discriminator property can have in a data. Therefore, the discriminator property name must be present when defining the mapping information.

PropertyValue
EnabledYes
Maximum SeverityWarning
MessageDiscriminator mapping values are present but no discriminator property was specified.
CodeAPIMATICPRE_V586
TypeValidation
Rule SystemSemantic
Broad CategoryGlobal Types/Models
Products ImpactedCode Generation, Developer Experience Portal, API Transformer
Tagspreliminary checks validation apimatic discriminator mapping values discriminator mapping discriminator global type combinators anyOf oneOf not

Suggested Fixes

  • Make sure that the discriminator property is specified in the type definition.
  • Make sure that the discriminator property is not null or empty.
  • Remove the discriminator mapping information if no discriminator property is specified.