Requires each operation to have an operationId defined.
| OAS | Compatibility |
|---|---|
| 2.0 | ✅ |
| 3.0 | ✅ |
| 3.1 | ✅ |
| 3.2 | ✅ |
The operationId is used by tooling to identify operations (which are otherwise done through scary looking JSON pointers). OpenAPI does not consider operationId a required field, but we'd describe it as a strongly recommended field.
This rule is unopinionated.
| Option | Type | Description |
|---|---|---|
| severity | string | Possible values: off, warn, error. Default warn (in recommended configuration). |
An example configuration:
rules:
operation-operationId: errorGiven this configuration:
rules:
operation-operationId: errorExample of an incorrect operation:
paths:
/cars:
get:
responses:
'200':
$ref: ./Success.yamlExample of a correct operation:
paths:
/cars:
get:
operationId: GetCar
responses:
'200':
$ref: ./Success.yaml- OperationIds make good API design - Redocly Blog
- Rule source
- Operation object docs
- Consider using configurable rules for more specific rules for
operationIds such as length, casing, and pattern enforcement.