at-least-one-item-in-server-variable-enum-list
Overview
This rule belongs to the openapi-v3-standards-linting
ruleset and states that:
If an enumeration list is declared using the enum
property it must contain at least one string-valued entry which can be used for substitution i.e. the enumeration array should not be empty.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Warning |
Message | Server variable enum array is empty. |
Code | OPENAPI3STANDARDS_L010 |
Type | Linting |
Rule System | Semantic |
Broad Category | Server Variables |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi standards semantic linting enum server variable variable server |
Suggested Fixes
- If substitution options are from a limited set, add those in the enumeration list.
- The substitution options to be added in the enumeration list must be string values.
- If substitution options are not known beforehand or are not expected to be limited to a specific set of values, remove the
enum
property declaration.