You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: versions/3.0.md
+58-3Lines changed: 58 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1555,15 +1555,70 @@ description: object created
1555
1555
1556
1556
#### <a name="callbackObject"></a>Callback Object
1557
1557
1558
-
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.
1558
+
A map of possible out-of band callbacks related to the parent operation. Each value in the map is an [operation object](#operationObject) that describes a request that may be initiated by the API provider and the responses expected. The key value used to identify callback object is an expression, that when evaluated at runtime, identifies a URL to used for the callback operation.
1559
1559
1560
1560
##### Patterned Fields
1561
1561
Field Pattern | Type | Description
1562
1562
---|:---:|---
1563
-
<a name="responseName"></a>Callback name | [Callback Operation Object](#operationObject) <span>|</span> [Operation Object](#operationObject) | An operation object used to define a callback payload structure
1563
+
<a name="responseName"></a>Callback name | [Callback Operation Object](#operationObject) <span>|</span> [Operation Object](#operationObject) | An operation object used to define a callback request and expected responses
1564
1564
1565
1565
This object can be extended with [Specification Extensions](#specificationExtensions).
1566
1566
1567
+
##### Key Expression
1568
+
1569
+
The key used to identify the callback object is also an expression that can be evaluated on the runtime HTTP request/response to identify the URL to be used for the callback request. A simple example might be "$request.body.url". However, the expression syntax enables accessing the complete HTTP message and reaching into any payload that can map to an object/array/property data model.
1570
+
1571
+
The expression is defined by the following [ABNF](https://tools.ietf.org/html/rfc5234) syntax
char = as per RFC [7159](https://tools.ietf.org/html/rfc7159#section-7)
1584
+
token = as per RFC [7230](https://tools.ietf.org/html/rfc7230#section-3.2.6)
1585
+
```
1586
+
1587
+
The `name` identifier is case-sensitive, whereas `token` is not.
1588
+
1589
+
Given the following HTTP request:
1590
+
1591
+
```http
1592
+
POST /subscribe/myevent?queryUrl=http://clientdomain.com/stillrunning HTTP/1.1
1593
+
Host: example.org
1594
+
Content-Type: application/json
1595
+
Content-Length: 123
1596
+
1597
+
{
1598
+
"failedurl" : "http://clientdomain.com/failed"
1599
+
"successurls : [
1600
+
"http://clientdomain.com/fast",
1601
+
"http://clientdomain.com/medium",
1602
+
"http://clientdomain.com/slow"
1603
+
]
1604
+
}
1605
+
1606
+
201 Created
1607
+
Location: http://example.org/subscription/1
1608
+
1609
+
```
1610
+
1611
+
Here are the examples of how the various expressions evaluate, assuming a the callback operation has a path parameter named `eventType` and a query parameter named `queryUrl`.
0 commit comments