no-undefined-server-variable

October 16, 2025 · View on GitHub

Disallow undefined server variables.

OASCompatibility
2.0
3.0
3.1
3.2
flowchart TD

Root ==> ServersList --> Server --> ServerVariable

style ServerVariable fill:#codaf9,stroke:#0044d4,stroke-width:5px

API design principles

If a variable is declared but not defined, it's an error with the specification.

It is important to fix these errors to help clients consume APIs.

Configuration

OptionTypeDescription
severitystringPossible values: off, warn, error. Default error (in recommended configuration).

An example configuration:

rules:
  no-undefined-server-variable: error

Examples

Given this configuration:

rules:
  no-undefined-server-variable: error

Example of incorrect server variables:

servers:
  - url: 'https://{tenant}/api/v1'

Example of correct server variables:

servers:
  - url: 'https://{tenant}/api/v1'
    variables:
      tenant:
        default: api.example.com
        description: Your server host

Resources