Skip to main content

valid-numeric-enum-default-value

Overview

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

Default values of all enumeration model fields must be set. In case they are missing or invalid and the enumeration model is of numeric type, we may infer the default values ourselves.

PropertyValue
EnabledYes
Maximum SeverityWarning
MessageMissing/invalid default value of the numeric enumeration model field was replaced with an ordinal value.
CodeAPIMATICPOSTPROCESS_V401
TypeValidation
Rule SystemSemantic
Broad CategoryGlobal Types/Models
Products ImpactedCode Generation, Developer Experience Portal, API Transformer
Tagsapimatic postprocessing validation default value enumeration type custom type model complex model

Suggested Fixes

  • Set non-empty, non-null and valid numeric default values of all enumeration model fields to avoid this issue.