diff --git a/src/oas.md b/src/oas.md
index 5d56bed793..ebb932af29 100644
--- a/src/oas.md
+++ b/src/oas.md
@@ -932,6 +932,8 @@ The path itself is still exposed to the documentation viewer but they will not k
| head | [Operation Object](#operation-object) | A definition of a HEAD operation on this path. |
| patch | [Operation Object](#operation-object) | A definition of a PATCH operation on this path. |
| trace | [Operation Object](#operation-object) | A definition of a TRACE operation on this path. |
+| query | [Operation Object](#operation-object) | A definition of a QUERY operation, as defined in the most recent IETF draft ([draft-ietf-httpbis-safe-method-w-body-08](https://www.ietf.org/archive/id/draft-ietf-httpbis-safe-method-w-body-08.html) as of this writing) or its RFC successor, on this path. |
+| additionalOperations | Map[`string`, [Operation Object](#operation-object)] | A map of additional operations on this path. The map key is the HTTP method with the same capitalization that is to be sent in the request. This map MUST NOT contain any entry for the methods that can be defined by other Operation Object fields (e.g. no `POST` entry, as the Operation Object field `post` is used for this method). |
| servers | [[Server Object](#server-object)] | An alternative `servers` array to service all operations in this path. If a `servers` array is specified at the [OpenAPI Object](#oas-servers) level, it will be overridden by this value. |
| parameters | [[Parameter Object](#parameter-object) \| [Reference Object](#reference-object)] | A list of parameters that are applicable for all the operations described under this path. These parameters can be overridden at the operation level, but cannot be removed there. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a [name](#parameter-name) and [location](#parameter-in). The list can use the [Reference Object](#reference-object) to link to parameters that are defined in the [OpenAPI Object's `components.parameters`](#components-parameters). |
@@ -985,7 +987,39 @@ This object MAY be extended with [Specification Extensions](#specification-exten
},
"style": "simple"
}
- ]
+ ],
+ "additionalOperations": {
+ "COPY": {
+ "description": "Copies pet information based on ID",
+ "summary": "Copies pets by ID",
+ "operationId": "copyPetsById",
+ "responses": {
+ "200": {
+ "description": "pet response",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Pet"
+ }
+ }
+ }
+ }
+ },
+ "default": {
+ "description": "error payload",
+ "content": {
+ "text/html": {
+ "schema": {
+ "$ref": "#/components/schemas/ErrorModel"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
}
```
@@ -1019,6 +1053,26 @@ parameters:
items:
type: string
style: simple
+additionalOperations:
+ COPY:
+ description: Copies pet information based on ID
+ summary: Copies pets by ID
+ operationId: copyPetsById
+ responses:
+ '200':
+ description: pet response
+ content:
+ '*/*':
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Pet'
+ default:
+ description: error payload
+ content:
+ text/html:
+ schema:
+ $ref: '#/components/schemas/ErrorModel'
```
#### Operation Object
diff --git a/src/schemas/validation/schema.yaml b/src/schemas/validation/schema.yaml
index 8d14aec869..3f804ad16b 100644
--- a/src/schemas/validation/schema.yaml
+++ b/src/schemas/validation/schema.yaml
@@ -230,6 +230,24 @@ $defs:
type: array
items:
$ref: '#/$defs/parameter-or-reference'
+ additionalOperations:
+ type: object
+ additionalProperties:
+ $ref: '#/$defs/operation'
+ propertyNames:
+ $comment: RFC9110 restricts methods to "1*tchar" in ABNF
+ pattern: "^[a-zA-Z0-9!#$%&'*+.^_`|~-]+$"
+ not:
+ enum:
+ - GET
+ - PUT
+ - POST
+ - DELETE
+ - OPTIONS
+ - HEAD
+ - PATCH
+ - TRACE
+ - QUERY
get:
$ref: '#/$defs/operation'
put:
@@ -246,6 +264,8 @@ $defs:
$ref: '#/$defs/operation'
trace:
$ref: '#/$defs/operation'
+ query:
+ $ref: '#/$defs/operation'
$ref: '#/$defs/specification-extensions'
unevaluatedProperties: false
diff --git a/tests/schema/fail/path-item-object-conflicting-additional-operation.yaml b/tests/schema/fail/path-item-object-conflicting-additional-operation.yaml
new file mode 100644
index 0000000000..f068406b68
--- /dev/null
+++ b/tests/schema/fail/path-item-object-conflicting-additional-operation.yaml
@@ -0,0 +1,64 @@
+openapi: 3.2.0
+info:
+ title: API
+ version: 1.0.0
+paths:
+ /pets/{id}:
+ get:
+ description: Returns pets based on ID
+ summary: Find pets by ID
+ operationId: getPetsById
+ responses:
+ '200':
+ description: pet response
+ content:
+ '*/*':
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Pet'
+ default:
+ description: error payload
+ content:
+ text/html:
+ schema:
+ $ref: '#/components/schemas/ErrorModel'
+ parameters:
+ - name: id
+ in: path
+ description: ID of pet to use
+ required: true
+ schema:
+ type: array
+ items:
+ type: string
+ style: simple
+ additionalOperations:
+ POST:
+ description: Returns pets based on ID
+ summary: Find pets by ID
+ operationId: postPetsById
+ requestBody:
+ description: ID of pet to use
+ required: true
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ type: string
+ responses:
+ '200':
+ description: pet response
+ content:
+ '*/*':
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Pet'
+ default:
+ description: error payload
+ content:
+ text/html:
+ schema:
+ $ref: '#/components/schemas/ErrorModel'
\ No newline at end of file
diff --git a/tests/schema/pass/path-item-object-example.yaml b/tests/schema/pass/path-item-object-example.yaml
index 234325e21a..0ecc2d64fa 100644
--- a/tests/schema/pass/path-item-object-example.yaml
+++ b/tests/schema/pass/path-item-object-example.yaml
@@ -23,6 +23,25 @@ paths:
text/html:
schema:
$ref: '#/components/schemas/ErrorModel'
+ query:
+ description: Returns pets based on ID
+ summary: Find pets by ID
+ operationId: queryPetsById
+ responses:
+ '200':
+ description: pet response
+ content:
+ '*/*':
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Pet'
+ default:
+ description: error payload
+ content:
+ text/html:
+ schema:
+ $ref: '#/components/schemas/ErrorModel'
parameters:
- name: id
in: path
@@ -32,4 +51,24 @@ paths:
type: array
items:
type: string
- style: simple
\ No newline at end of file
+ style: simple
+ additionalOperations:
+ COPY:
+ description: Copies pet information based on ID
+ summary: Copies pets by ID
+ operationId: copyPetsById
+ responses:
+ '200':
+ description: pet response
+ content:
+ '*/*':
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Pet'
+ default:
+ description: error payload
+ content:
+ text/html:
+ schema:
+ $ref: '#/components/schemas/ErrorModel'
\ No newline at end of file