JSON Pointer is a string syntax for identifying a specific value within a JSON document. In Spectral, it targets the OpenAPI object whose linting-rule severity or activation an override changes. section 3.9
Use JSON Pointers to scope linting policy to individual OpenAPI operations:
- Reference an operation with a file path followed by its JSON Pointer, such as openapi.yaml#/paths/~1users~1%7Bid%7D/put. section 3.9
- Disable a rule for one operation or downgrade another operation to a warning while retaining the default error severity elsewhere. section 3.9
overrides:
- files:
- openapi.yaml#/paths/~1users~1%7Bid%7D/put #1
rules:
operation-must-have-operationId: off
- files:
- openapi.yaml#/paths/~1users~1%7Bid%7D/delete
rules:
operation-must-have-operationId: warn #2
rules:
operation-must-have-operationId:
message: 'Each operation must have an operationId'
severity: error
given: '$.paths[*][get,put,post,delete,options,head,patch,trace]'
then:
field: operationId
function: truthy
Inspect the complete Spectral override configuration and the resulting warning for the DELETE operation. section 3.9

