Skip to content

Commit 9a9c498

Browse files
committed
Add some more examples
1 parent e4ca9a6 commit 9a9c498

File tree

1 file changed

+109
-0
lines changed

1 file changed

+109
-0
lines changed

draft-release-notes.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,109 @@ Tags get an upgrade, with some new fields to make them more useful and reflect s
2020
The `kind` field is free-form text, however there are some expected/conventional values such as `nav` (in line with the most common current usage as grouping for documentation output).
2121
- A [registry](https://spec.openapis.org/registry/tag-kind/index.html) to establish conventions for values used in `kind`.
2222

23+
An example of nested tags using the new fields might be as follows:
24+
25+
```yaml
26+
tags:
27+
- name: products
28+
summary: Products
29+
description: All cake and bakery product operations
30+
kind: nav
31+
32+
- name: cakes
33+
summary: Cakes and Treats
34+
description: Cake catalog, ordering, and customization
35+
parent: products
36+
kind: nav
37+
38+
- name: extra
39+
summary: Accessories
40+
description: Candles, decorations, and cake serving supplies
41+
parent: products
42+
kind: nav
43+
44+
- name: seasonal
45+
summary: Seasonal
46+
description: Limited-time seasonal offerings
47+
kind: badge
48+
externalDocs:
49+
description: Seasonal menu planning guide
50+
url: https://docs.cakestore.com/seasonal-planning
51+
```
52+
2353
#### Support additional HTTP methods
2454
2555
- Support the new `query` method alongside the existing `get`/`post`/`put`/`delete`/`options`/`head`/`patch`/`trace`.
56+
Query is a new method in the HTTP standard, designed to allow complex filtering query data to be sent in the body of a request when it doesn't fit in the query string.
2657
- Under an `additionalOperations` entry in a Path, use any other methods not listed as keys using the correct capitalization. e.g. do NOT add HEAD under this, use the existing sibling `head`.
2758

59+
The following example describes both `query` and `link` methods for the `cakes/` endpoint:
60+
61+
```yaml
62+
paths:
63+
/cakes:
64+
get:
65+
summary: List available cakes
66+
responses:
67+
'200':
68+
description: List of cakes
69+
content:
70+
application/json:
71+
schema:
72+
type: array
73+
items:
74+
$ref: '#/components/schemas/Cake'
75+
76+
query:
77+
summary: Advanced cake search with complex filtering
78+
description: Search cakes using advanced query syntax in request body
79+
requestBody:
80+
required: true
81+
content:
82+
application/json:
83+
schema:
84+
type: object
85+
properties:
86+
filter:
87+
type: string
88+
example: "flavor:chocolate AND price:<20"
89+
sort:
90+
type: array
91+
items:
92+
type: string
93+
example: ["price:asc", "rating:desc"]
94+
responses:
95+
'200':
96+
description: Search results
97+
content:
98+
application/json:
99+
schema:
100+
type: array
101+
items:
102+
$ref: '#/components/schemas/Cake'
103+
104+
additionalOperations:
105+
LINK:
106+
summary: Link related cake products
107+
description: Create associations between cakes and accessories
108+
requestBody:
109+
required: true
110+
content:
111+
application/json:
112+
schema:
113+
type: object
114+
properties:
115+
targetResource:
116+
type: string
117+
example: "/accessories/candles/123"
118+
relationship:
119+
type: string
120+
example: "recommended-with"
121+
responses:
122+
'204':
123+
description: Link created successfully
124+
```
125+
28126
#### Document identity and URL resolution
29127

30128
- Additional top-level field `$self` is added to allow users to define the base URI of the document, used to resolve relative references.
@@ -34,6 +132,17 @@ Tags get an upgrade, with some new fields to make them more useful and reflect s
34132
- Relative links inside `description` fields are resolved relative to their rendered context, such as your published API documentation page.
35133
- API endpoints are resolved against the URL in the Server Object, which itself might be relative and resolved against the base URI.
36134

135+
The following example shows the new `$self` field in use:
136+
137+
```yaml
138+
openapi: 3.2.0
139+
$self: https://cake-api.example.com/openapi.yaml
140+
info:
141+
title: Cake Store API
142+
version: 1.0.3
143+
description: API for managing cake orders and inventory
144+
```
145+
37146
### Data modeling and representation
38147

39148
OpenAPI specification v3.2 brings consistent, modular, and extensible media type and parameter support, while also expanding the set of media types supported in response to both emerging and legacy use cases. In addition, the ambiguity regarding how to present examples in a variety of complex scenarios is reduced.

0 commit comments

Comments
 (0)