Disallow undefined server variables.
| OAS | Compatibility |
|---|---|
| 2.0 | ❌ |
| 3.0 | ✅ |
| 3.1 | ✅ |
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.
| Option | Type | Description |
|---|---|---|
| severity | string | Possible values: off, warn, error. Default error (in recommended configuration). |
An example configuration:
rules:
no-undefined-server-variable: errorGiven this configuration:
rules:
no-undefined-server-variable: errorExample 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