Ensures that the additionalOperations map of a path item does not hold a method that has its own field.
| OAS | Compatibility |
|---|---|
| 2.0 | ❌ |
| 3.0 | ❌ |
| 3.1 | ❌ |
| 3.2 | ✅ |
OpenAPI 3.2 adds the additionalOperations field to the Path Item Object. It describes the operations for HTTP methods that have no field of their own, such as LINK or PURGE.
The specification does not allow an entry for a method that has its own field: GET, PUT, POST, DELETE, OPTIONS, HEAD, PATCH, TRACE, or QUERY. With such an entry, a path item can describe the same method twice, and tools can read it in different ways.
The keys of the map are case-sensitive, because a key holds the method with the capitalization that the request uses. The rule reports only the names in capital letters.
| Option | Type | Description |
|---|---|---|
| severity | string | Possible values: off, warn, error. Default error (in recommended configuration). |
An example configuration:
rules:
spec-no-invalid-additionalOperations: error
Given this configuration:
rules:
spec-no-invalid-additionalOperations: error
Example of an incorrect path item:
paths:
/menu:
additionalOperations:
GET:
operationId: listMenuItems
responses:
'200':
description: Successful operation.
Example of a correct path item:
paths:
/menu:
get:
operationId: listMenuItems
responses:
'200':
description: Successful operation.
additionalOperations:
LINK:
operationId: linkMenuItems
responses:
'204':
description: Successful operation.