x-enum-descriptions
Use x-enum-descriptions to explain what each value of an enum means. Zudoku lists the
descriptions next to their values wherever the enum is shown: in request and response schemas,
object properties, and parameters. Without it, readers see the values only.
Zudoku accepts both x-enum-descriptions and x-enumDescriptions. If a schema sets both, the
camelCase x-enumDescriptions takes precedence.
Location
The extension is added at the Schema Object level, next to the enum it describes. For an
array, add it to the items schema. For a parameter, add it to the parameter's schema.
| Option | Type | Description |
|---|---|---|
x-enum-descriptions or x-enumDescriptions | object or string[] | A description for each enum value, in one of the formats below. |
Formats
Map of values to descriptions
Use an object whose keys are enum values and whose values are descriptions.
Code
Map nested under values
Some generators wrap the same map in a values property. Zudoku reads it the same way.
Code
Array aligned with enum
Use an array of strings where each entry describes the enum value at the same position. Tools such
as openapi-generator emit this format.
Code
Keep the array in the same order as enum. Zudoku pairs entries by position, ignores empty entries,
and ignores entries beyond the length of enum.
Behavior
- A value without a description is still listed in the enum, with an empty description.
- Entries that aren't strings are ignored.
- If no usable descriptions remain, Zudoku shows the plain list of enum values.
Related
x-display-name— set a friendlier label for a tag