When an existing API cannot satisfy every lint rule immediately, keep one shared ruleset and introduce compliance incrementally. Enable passing rules, then disable or regrade failing rules for specific OpenAPI objects. New extensions still meet current standards, while exceptions remain visible for later nondisruptive improvements. section 3.9
Implement the approach with targeted Spectral overrides:
- Identify the OpenAPI document and object that cannot yet satisfy a rule. section 3.9
- Use a file path glob and JSON pointer to target that object. section 3.9
- Set the rule to off or warn instead of removing it from the shared ruleset. section 3.9
- Revisit disabled rules when a nondisruptive API change becomes possible; some live endpoints may retain exceptions. section 3.9
Selective operationId enforcement
A shared rule requires every operation to have an operationId. An override turns it off for PUT /users/{id} and changes it to warn for DELETE /users/{id}; linting then reports the delete operation as a warning rather than an error.
