operation-operationId
Requires every non-callback operation to contain a nonblank string operationId.
| Attribute | Value |
|---|---|
| Category | Operations |
| Maturity | Silver |
| OpenAPI | Swagger 2.0; OpenAPI 3.0, 3.1, 3.2 |
| Starter–Strict | Warning |
| Complete | Error |
Intent
A stable operation ID gives generators, documentation, and automation a language-independent handle for the operation.
Flags
A regular operation whose operationId is missing, non-string, empty, or whitespace-only.
Does not flag
Callback operations or operations with a nonblank string ID.
See it fail
get:
summary: Get a payment
responses:
'200': {description: OK}
Diagnostic: Operation object should contain `operationId` field.
Fix it
get:
operationId: getPayment
summary: Get a payment
responses:
'200': {description: OK}
Configure
profiles:
default:
rules:
extends: [recommended]
override:
operation-operationId: error
Nearby: operation-operationId-unique, operation-operationId-url-safe.