Skip to main content

required-enum-default-value

Overview

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

All fields of an enumeration model must have a non-empty and non-null default value set. The default values represent the set of possible values of the enumeration and, therefore, cannot be empty or null.

PropertyValue
EnabledYes
Maximum SeverityError
MessageThe default value of one or more fields of the enumeration model is not set.
CodeAPIMATICPRE_V516
TypeValidation
Rule SystemSemantic
Broad CategoryGlobal Types/Models
Products ImpactedCode Generation, Developer Experience Portal, API Transformer
Tagspreliminary checks validation apimatic default value enumeration type field custom type model complex model

Suggested Fixes

  • Make sure the default value of all fields of the enumeration model is set.
  • Make sure that the default value of all fields of the enumeration model is non-empty, non-null.
  • The default values represent the actual values of the enumeration.

For More Information