Name: Enums format
Status: approved
Created: 2025-02-12
Updated: 2025-02-12

Enums format (#126)

It is common for a field to have a limited set of supported values. This is most commonly known as enumerations (shorten enum).

Guidance

Kong apis should prefer lowercase_snake_case. Diverging from this rule should be the exception and API designers should provide a rationale for that exception.

A zero value for an enum should be defined as unknown.

Any ambiguity should fall back to the rules of Google AIP-126.

Avoiding boolean fields

When a field has only two possible values, it is tempting to use a boolean field. However, this is not recommended. Instead, use an enum with two values. This allows for future expansion of the field without breaking existing clients.