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: draft-release-notes.md
+86-12Lines changed: 86 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,9 +27,9 @@ A summary of the biggest changes.
27
27
- Additional top-level field `$self` is added to allow users to define the base URI of the document, used to resolve relative references.
28
28
If no `$self` field is defined, then the retrieval URI is used - just as it was in previous versions of OpenAPI.
29
29
- Other URL/URI handling does not change between 3.1 and 3.2 (but bears a recap in case you're wondering how it all goes together):
30
-
- Other URLs, such as to external documentation or a license, are resolved against the base URI.
31
-
- Relative links inside `description` fields are resolved relative to their rendered context, such as your published API documentation page.
32
-
- API endpoints are resolved against the URL in the Server Object, which itself might be relative and resolved against the base URI.
30
+
- Other URLs, such as to external documentation or a license, are resolved against the base URI.
31
+
- Relative links inside `description` fields are resolved relative to their rendered context, such as your published API documentation page.
32
+
- API endpoints are resolved against the URL in the Server Object, which itself might be relative and resolved against the base URI.
33
33
34
34
### Data modeling and representation
35
35
@@ -79,39 +79,113 @@ OpenAPI specification v3.2 brings consistent, modular, and extensible media type
79
79
80
80
### Additional features
81
81
82
-
That's not all! Here are the rest of the changes for this release.
82
+
That's not all! Here are the rest of the changes for this release, each one is small but mighty!
83
83
84
84
#### Updated security schemes
85
85
86
-
- Support for OAuth2 Device Authorization flow with additional `deviceAuthorization` field in the `flows` object and for the individual flow, a new field `deviceAuthorizationUrl` alongside `tokenUrl`.
87
-
- Additional security scheme field: `oauth2MetadataUrl` URL for auth server metadata.
86
+
- Support for [OAuth2 Device Authorization flow](https://datatracker.ietf.org/doc/html/rfc8628) with additional `deviceAuthorization` field in the `flows` object and for the individual flow, a new field `deviceAuthorizationUrl` alongside `tokenUrl`. This flow is designed for devices that have limited inputs such as TVs, printers, and kiosks.
87
+
- Additional security scheme field: `oauth2MetadataUrl` URL for auth server metadata, as described by the [OAuth2 Server Metadata Standard](https://datatracker.ietf.org/doc/html/rfc8414).
88
88
- Additional `deprecated` field for security schemes (indicating that the scheme may still be supported, but that it should not be used).
89
89
- Ability to reference a security scheme by URI rather than needing it declared in components.
- Clarify that server URLs should not include fragment or query.
94
111
- Support new `name` field alongside `description`, `url` and `variables`.
95
-
- Formal path templating support for variable substitution in server urls, alongside guidance that each variable can only be used once in a URL.
112
+
- Formal ABNF syntax for the allowed variable substitution in server urls, alongside guidance that each variable can only be used once in a URL.
113
+
114
+
Use the name field to refer to servers easily:
115
+
116
+
```yaml
117
+
servers:
118
+
- name: Production
119
+
url: https://api.cakestore.com/v1
120
+
description: Production server for live cake orders
121
+
- name: Staging
122
+
url: https://staging-api.cakestore.com/v1
123
+
description: Staging environment for testing new cake recipes and features
124
+
- name: Local
125
+
url: http://localhost:3000/v1
126
+
description: Local development server running on your machine
127
+
```
96
128
97
129
#### Better polymorphic support
98
130
131
+
Discriminator is a great way to match the correct schema to a payload. This release gives more robustness by adding support for a default type so that unknown objects can be handled safely.
132
+
99
133
- The discriminator `propertyName` can now be an optional field.
100
-
-Additional `defaultMapping` field to indicate which schema to use if the `propertyName` is not set, or if the value is unrecognized.
134
+
- New field `defaultMapping` to indicate which schema to use if the `propertyName` is not set, or if the value is unrecognized.
101
135
- No change from previous versions: use `discriminator` to hint which entry in `anyOf` or `oneOf` is expected.
102
136
- No change from previous versions: use `mapping` to link the discriminator property value to the Schema name if they aren't an exact match.
103
137
- Implementations now SHOULD (rather than MAY) support templates/generics using `$dynamicRef`.
104
138
105
-
#### Path templating
106
-
107
-
**ABNF** (Augmented Backus–Naur Form) formalised for path templating, server variables, and runtime expressions in the Links object.
139
+
Define the `mapping` and `discriminator` as before. The new field `defaultMapping` will be used if either the discriminator doesn't have a `propertyName` or when there is an object that doesn't match a `mapping` entry.
140
+
141
+
```yaml
142
+
schemas:
143
+
Cake:
144
+
type: object
145
+
discriminator:
146
+
propertyName: cakeType
147
+
defaultMapping: sponge
148
+
mapping:
149
+
sponge: '#/components/schemas/SpongeCake'
150
+
chocolate: '#/components/schemas/ChocolateCake'
151
+
fruit: '#/components/schemas/FruitCake'
152
+
properties:
153
+
cakeType:
154
+
type: string
155
+
enum: [sponge, chocolate, fruit]
156
+
name:
157
+
type: string
158
+
```
159
+
160
+
#### Templates with formal syntax
161
+
162
+
The specification now includes **ABNF** (Augmented Backus–Naur Form) for path templating, server variables, and runtime expressions in the Links object.
163
+
This sounds terribly formal but it means that there is a clear syntax for what is supported in each of those locations, that existing tooling can understand.
164
+
165
+
Next time you're wondering if you can do `/api/v{version}/users/{user-id}` in a path template, it'll be easy to check (spoiler: yes you can).
108
166
109
167
#### Flexible response metadata fields
110
168
111
169
- `description`field for responses are now optional (they used to be required but they could be empty).
112
170
- Additional `summary` field for responses, useful when displaying responses in a list context.
113
171
114
-
#### Minor edits that are worth a mention
172
+
```yaml
173
+
/cakes:
174
+
get:
175
+
summary: List cakes
176
+
responses:
177
+
'200':
178
+
summary: Cake list
179
+
description: A list of cakes (this field is no longer required)
180
+
content:
181
+
application/json:
182
+
schema:
183
+
type: array
184
+
items:
185
+
type: string
186
+
```
187
+
188
+
#### Minor updates that are worth a mention
115
189
116
190
- Streamlined to YAML examples (unless something specific to another format) to try to make it easier to follow.
117
191
- Non-Schema examples no longer "override" Schema examples; tools are free to use the most appropriate example for any given use case.
0 commit comments