Skip to main content



This rule belongs to the swagger-v2-standards-validation ruleset and states that:

The name specified for the discriminator in the Schema Object must correspond with a required property name defined in the required property of the schema object it is part of.

Maximum SeverityError
MessageThe discriminator property cannot be optional.
Rule SystemSemantic
Broad CategorySchemas
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsswagger2 swagger standards semantic validation discriminator name schema schema object properties property

Suggested Fixes

  • Add the missing required property name to the required property of the Schema Object.
  • Make sure that the name assigned to the discriminator in the Schema Obect matches exactly with the name of one of the required property names. Names are compared in a case-sensitive manner.

For More Information