Skip to content

Commit b1430f9

Browse files
authored
Merge pull request OAI#763 from OAI/feature/callbacks
Callback feature
2 parents 19582c9 + dbf5f6d commit b1430f9

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

versions/3.0.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,7 @@ Field Name | Type | Description
472472
<a name="operationParameters"></a>parameters | [[Parameter Object](#parameterObject) <span>&#124;</span> [Reference Object](#referenceObject)] | A list of parameters that are applicable for this operation. If a parameter is already defined at the [Path Item](#pathItemParameters), the new definition will override it, but can never remove it. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a [name](#parameterName) and [___location](#parameterIn). The list can use the [Reference Object](#referenceObject) to link to parameters that are defined at the [OpenAPI Object's parameters](#oasParameters).
473473
<a name="operationRequestBody"></a>requestBody | [[Request Body Object](#requestBodyObject) <span>&#124;</span> [Reference Object](#referenceObject)] | The request body applicable for this operation.
474474
<a name="operationResponses"></a>responses | [Responses Object](#responsesObject) | **Required.** The list of possible responses as they are returned from executing this operation.
475+
<a name="operationCallbacks"></a>callback responses | [Callback Responses Object](#callbackObject) | The list of possible callback responses as they are returned from executing this operation.
475476
<a name="operationSchemes"></a>schemes | [`string`] | The transfer protocol for the operation. Values MUST be from the list: `"http"`, `"https"`, `"ws"`, `"wss"`. The value overrides the OpenAPI Object [`schemes`](#oasSchemes) definition.
476477
<a name="operationDeprecated"></a>deprecated | `boolean` | Declares this operation to be deprecated. Usage of the declared operation should be refrained. Default value is `false`.
477478
<a name="operationSecurity"></a>security | [[Security Requirement Object](#securityRequirementObject)] | A declaration of which security schemes are applied for this operation. The list of values describes alternative security schemes that can be used (that is, there is a logical OR between the security requirements). This definition overrides any declared top-level [`security`](#oasSecurity). To remove a top-level security declaration, an empty array can be used.
@@ -1248,6 +1249,36 @@ Response with no return value:
12481249
description: object created
12491250
```
12501251

1252+
#### <a name="callbackObject"></a>Callback Object
1253+
1254+
A container for possible out-of band callbacks from an operation. A callback may be returned from an operation, calling back to the path specified in the operation object.
1255+
1256+
##### Patterned Fields
1257+
Field Pattern | Type | Description
1258+
---|:---:|---
1259+
<a name="responseName"></a>Callback name | [Callback Operation Object](#operationObject) <span>&#124;</span> [Operation Object](#operationObject) | An operation object used to define a callback payload structure
1260+
<a name="responsesExtensions"></a>^x- | Any | Allows extensions to the OpenAPI Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. The value can be `null`, a primitive, an array or an object. See [Specification Extensions](#specificationExtensions) for further details.
1261+
1262+
1263+
##### Callback Object Example
1264+
1265+
A callback to the URL specified by the `url` parameter in the request
1266+
1267+
1268+
```yaml
1269+
myWebhook:
1270+
'$request.url':
1271+
post:
1272+
body:
1273+
name: postResponse
1274+
schema:
1275+
$ref: '#/definitions/SomePayload'
1276+
responses:
1277+
200:
1278+
description: webhook successfully processed an no retries will be performed
1279+
```
1280+
1281+
12511282
#### <a name="headersObject"></a>Headers Object
12521283
Lists the headers that can be sent as part of a response.
12531284

0 commit comments

Comments
 (0)