Skip to main content

valid-discriminator-mapping-key

Overview

This rule belongs to the openapi-v3-syntax-validation ruleset and states that:

Discriminator mapping keys must be string values.

PropertyValue
EnabledYes
Maximum SeverityError
MessageDiscriminator mapping key is not a string value.
CodeOPENAPI3SYNTAX_V160
TypeValidation
Rule SystemSyntax
Broad CategoryDiscriminators
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 openapi syntax validation key discriminator mapping discriminator string

Suggested Fixes

  • If the value is a number or boolean, surround it in single or double quotes so it can be treated correctly as a string.
  • Only string values are allowed as discriminator mapping keys.

For More Information