Spectral overrides customize one ruleset for different OpenAPI documents or objects. They support gradual consistency: disable or lower a rule’s severity for selected live endpoints while preserving stricter checks elsewhere. section 3.9
An override identifies:
- Target files or document fragments through a file path glob and, when needed, a JSON Pointer. section 3.9
- The linting rule whose severity changes, such as operation-must-have-operationId: off or warn. section 3.9
- Percent-encode path characters in pointers, as in /paths/~1users~1%7Bid%7D/put. section 3.9
Disable or warn selectively
A ruleset can turn operation-must-have-operationId off for PUT /users/{id}, but set it to warn for DELETE /users/{id}. Running `spectral lint openapi.yaml --ruleset ruleset2.yaml` reports a warning for the delete operation while suppressing the PUT violation. section 3.9
Figure 3.5 Structure of Spectral overrides
Use the override structure diagram to distinguish document targets, JSON Pointer locations, and rule severity changes. section 3.9




