Skip to content

Commit 4305fb8

Browse files
authored
Merge branch 'OpenAPI.next' into patch-23
2 parents fbaf8aa + 90d6399 commit 4305fb8

File tree

2 files changed

+83
-4
lines changed

2 files changed

+83
-4
lines changed

examples/v3.0/callback-example.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
paths:
2+
/streams:
3+
post:
4+
description: subscribes a client to receive out-of-band data
5+
parameters:
6+
- name: callbackUrl
7+
in: query
8+
required: true
9+
description: |
10+
the ___location where data will be sent. Must be network accessible
11+
by the source server
12+
schema:
13+
type: string
14+
format: uri
15+
example: https://tonys-server.com
16+
responses:
17+
'201':
18+
description: subscription successfully created
19+
content:
20+
application/json:
21+
schema:
22+
description: subscription information
23+
required:
24+
- subscriptionId
25+
properties:
26+
subscriptionId:
27+
description: this unique identifier allows management of the subscription
28+
type: string
29+
example: 2531329f-fb09-4ef7-887e-84e648214436
30+
callbacks:
31+
# the name `onData` is a convenience locator
32+
onData:
33+
# when data is sent, it will be sent to the `callbackUrl` provided
34+
# when making the subscription PLUS the suffix `/data`
35+
$request.query.callbackUrl/data:
36+
post:
37+
requestBody:
38+
description: subscription payload
39+
content:
40+
application/json:
41+
schema:
42+
properties:
43+
timestamp:
44+
type: string
45+
format: date-time
46+
userData:
47+
$ref: '#/components/schemas/UserLogData'
48+
responses:
49+
'202':
50+
description: |
51+
Your server implementation should return this HTTP status code
52+
if the data was received successfully
53+
'204':
54+
description: |
55+
Your server should return this HTTP status code if no longer interested
56+
in further updates

versions/3.0.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ For example, if a field has an array value, the JSON array representation will b
102102

103103
```json
104104
{
105-
"field": [...]
105+
"field": [ 1, 2, 3 ]
106106
}
107107
```
108108
All field names in the specification are **case sensitive**.
@@ -632,10 +632,33 @@ The path is appended to the URL from the [`Server Object`](#serverObject) in ord
632632

633633
Field Pattern | Type | Description
634634
---|:---:|---
635-
<a name="pathsPath"></a>/{path} | [Path Item Object](#pathItemObject) | A relative path to an individual endpoint. The field name MUST begin with a slash. The path is **appended** (no relative URL resolution) to the expanded URL from the [`Server Object`](#serverObject)'s `url` field in order to construct the full URL. [Path templating](#pathTemplating) is allowed.
635+
<a name="pathsPath"></a>/{path} | [Path Item Object](#pathItemObject) | A relative path to an individual endpoint. The field name MUST begin with a slash. The path is **appended** (no relative URL resolution) to the expanded URL from the [`Server Object`](#serverObject)'s `url` field in order to construct the full URL. [Path templating](#pathTemplating) is allowed. When matching URLs, concrete (non-templated) paths would be matched before their templated counterparts. Templated paths with the same hierarchy but different templated names MUST NOT exist as they are identical. In case of ambiguous matching, it's up to the tooling to decide which one to use.
636636

637637
This object can be extended with [Specification Extensions](#specificationExtensions).
638638

639+
##### Path Templating Matching
640+
641+
Assuming the following paths, the concrete definition, `/pets/mine`, will be matched first if used:
642+
643+
```
644+
/pets/{petId}
645+
/pets/mine
646+
```
647+
648+
The following paths are considered identical and invalid:
649+
650+
```
651+
/pets/{petId}
652+
/pets/{name}
653+
```
654+
655+
The following may lead to ambiguous resolution:
656+
657+
```
658+
/{entity}/me
659+
/books/{id}
660+
```
661+
639662
##### Paths Object Example
640663

641664
```json
@@ -1728,7 +1751,7 @@ The key value used to identify the callback object is an expression, evaluated a
17281751
##### Patterned Fields
17291752
Field Pattern | Type | Description
17301753
---|:---:|---
1731-
<a name="callbackExpression"></a>{expression} | [Path Item Object](#pathItemObject) | A Path Item Object used to define a callback request and expected responses.
1754+
<a name="callbackExpression"></a>{expression} | [Path Item Object](#pathItemObject) | A Path Item Object used to define a callback request and expected responses. A full example may be found at https://github.com/OAI/OpenAPI-Specification/blob/OpenAPI.next/examples/v3.0/callback-example.yaml
17321755

17331756
This object can be extended with [Specification Extensions](#specificationExtensions).
17341757

@@ -3351,7 +3374,7 @@ Field Name | Type | Validity | Description
33513374
<a name="securitySchemeDescription"></a>description | `string` | Any | A short description for security scheme. [CommonMark syntax](http://spec.commonmark.org/) can be used for rich text representation.
33523375
<a name="securitySchemeName"></a>name | `string` | `apiKey` | **REQUIRED**. The name of the header or query parameter to be used.
33533376
<a name="securitySchemeIn"></a>in | `string` | `apiKey` | **REQUIRED**. The ___location of the API key. Valid values are `"query"`, `"header"` or `"cookie"`.
3354-
<a name="securitySchemeScheme"></a>scheme | `string` | `http` | **REQUIRED**. The name of the HTTP Authorization scheme to be used in the [Authorization header as defined in RFC7235](https://tools.ietf.org/html/rfc7235#section-4.2).
3377+
<a name="securitySchemeScheme"></a>scheme | `string` | `http` | **REQUIRED**. The name of the HTTP Authorization scheme to be used in the [Authorization header as defined in RFC7235](https://tools.ietf.org/html/rfc7235#section-5.1).
33553378
<a name="securitySchemeBearerFormat"></a>bearerFormat | `string` | `http` (`"bearer"`) | A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes.
33563379
<a name="securitySchemeFlows"></a>flows | [OAuth Flows Object](#oauthFlowsObject) | `oauth2` | **REQUIRED**. An object containing configuration information for the flow types supported.
33573380
<a name="securitySchemeOpenIdConnectUrl"></a>openIdConnectUrl | `string` | `openIdConnect` | **REQUIRED**. OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of a URL.

0 commit comments

Comments
 (0)