AEP-0126 Linter Rules
Enum unspecified value
Enum unspecified value
This rule enforces that all enums have a default unspecified value, as mandated in AEP-126.
Because our APIs create automatically-generated client libraries, we need to
consider languages that have varying behavior around default values. To avoid
any ambiguity or confusion across languages, all enumerations should use an
“unspecified” value beginning with the name of the enum itself as the first
(0
) value.
Details
This rule finds all enumerations and ensures that the first one is named after
the enum itself with an _UNSPECIFIED
suffix appended.
Examples
Incorrect code for this rule:
Correct code for this rule:
Disabling
If you need to violate this rule, use a leading comment above the enum value. Remember to also include an aep.dev/not-precedent comment explaining why.
If you need to violate this rule for an entire file, place the comment at the top of the file.