Skip to content

Commit 77d22ce

Browse files
miquigithub-actions[bot]
authored andcommitted
Update JSON example files
1 parent cff6533 commit 77d22ce

2 files changed

Lines changed: 141 additions & 71 deletions

File tree

examples/v3.1/tictactoe.json

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,16 @@
6262
"$ref": "#/components/schemas/mark"
6363
}
6464
}
65+
},
66+
"links": {
67+
"markSquare": {
68+
"description": "Operation to use if the mark value returned indicates the square is empty",
69+
"operationId": "put-square",
70+
"parameters": {
71+
"row": "$request.path.row",
72+
"column": "$request.path.column"
73+
}
74+
}
6575
}
6676
},
6777
"400": {
@@ -90,6 +100,17 @@
90100
"description": "Places a mark on the board and retrieves the whole board and the winner (if any).",
91101
"tags": ["Gameplay"],
92102
"operationId": "put-square",
103+
"parameters": [
104+
{
105+
"name": "progressUrl",
106+
"in": "header",
107+
"description": "Progress URL that should be called if asynchronous response is returned",
108+
"required": false,
109+
"schema": {
110+
"type": "string"
111+
}
112+
}
113+
],
93114
"requestBody": {
94115
"required": true,
95116
"content": {
@@ -111,6 +132,17 @@
111132
}
112133
}
113134
},
135+
"202": {
136+
"description": "Mark operation has not completed. Use callback to check for progress",
137+
"headers": {
138+
"Location": {
139+
"description": "Callback URL",
140+
"schema": {
141+
"type": "string"
142+
}
143+
}
144+
}
145+
},
114146
"400": {
115147
"description": "The provided parameters are incorrect",
116148
"content": {
@@ -140,7 +172,32 @@
140172
{
141173
"user2AppOauth": ["board:write"]
142174
}
143-
]
175+
],
176+
"callbacks": {
177+
"statusCallback": {
178+
"{$request.header.progressUrl}": {
179+
"post": {
180+
"summary": "Status of mark operation",
181+
"description": "Provides the status of the mark operation",
182+
"operationId": "markOperationCallback",
183+
"requestBody": {
184+
"content": {
185+
"application/json": {
186+
"schema": {
187+
"$ref": "#/components/schemas/status"
188+
}
189+
}
190+
}
191+
},
192+
"responses": {
193+
"200": {
194+
"description": "Mark operation status received"
195+
}
196+
}
197+
}
198+
}
199+
}
200+
}
144201
}
145202
}
146203
},
@@ -257,5 +314,26 @@
257314
}
258315
}
259316
}
317+
},
318+
"webhooks": {
319+
"markStatus": {
320+
"post": {
321+
"summary": "Status of mark operation",
322+
"description": "Provides the status of the mark operation on completion",
323+
"operationId": "markOperationWebhook",
324+
"responses": {
325+
"200": {
326+
"description": "Mark operation has completed successfully",
327+
"content": {
328+
"application/json": {
329+
"schema": {
330+
"$ref": "#/components/schemas/status"
331+
}
332+
}
333+
}
334+
}
335+
}
336+
}
337+
}
260338
}
261339
}
Lines changed: 62 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,65 @@
11
{
2-
"openapi": "3.2.0",
3-
"info": {
4-
"title": "Flight API",
5-
"version": "1.0.0"
2+
"openapi": "3.2.0",
3+
"info": {
4+
"title": "Flight API",
5+
"version": "1.0.0"
6+
},
7+
"tags": [
8+
{
9+
"name": "flights",
10+
"summary": "Flights",
11+
"description": "Core flight operations",
12+
"kind": "nav"
613
},
7-
"tags": [
8-
{
9-
"name": "flights",
10-
"summary": "Flights",
11-
"description": "Core flight operations",
12-
"kind": "nav"
13-
},
14-
{
15-
"name": "international",
16-
"summary": "International",
17-
"description": "Flights that cross country borders",
18-
"parent": "flights",
19-
"kind": "nav"
20-
},
21-
{
22-
"name": "domestic",
23-
"summary": "Domestic",
24-
"description": "Flights within a single country",
25-
"parent": "flights",
26-
"kind": "nav"
27-
},
28-
{
29-
"name": "delays",
30-
"summary": "Delays",
31-
"description": "Information about flight delays",
32-
"kind": "badge",
33-
"externalDocs": {
34-
"description": "Delay compensation policies",
35-
"url": "https://docs.example.com/delay-policies"
36-
}
37-
}
38-
],
39-
"paths": {
40-
"/flights": {
41-
"get": {
42-
"tags": [
43-
"flights"
44-
],
45-
"summary": "List all flights"
46-
}
47-
},
48-
"/flights/international": {
49-
"get": {
50-
"tags": [
51-
"international"
52-
],
53-
"summary": "List international flights"
54-
}
55-
},
56-
"/flights/domestic": {
57-
"get": {
58-
"tags": [
59-
"domestic"
60-
],
61-
"summary": "List domestic flights"
62-
}
63-
},
64-
"/flights/delayed": {
65-
"get": {
66-
"tags": [
67-
"delays"
68-
],
69-
"summary": "Get delayed flights"
70-
}
71-
}
14+
{
15+
"name": "international",
16+
"summary": "International",
17+
"description": "Flights that cross country borders",
18+
"parent": "flights",
19+
"kind": "nav"
20+
},
21+
{
22+
"name": "domestic",
23+
"summary": "Domestic",
24+
"description": "Flights within a single country",
25+
"parent": "flights",
26+
"kind": "nav"
27+
},
28+
{
29+
"name": "delays",
30+
"summary": "Delays",
31+
"description": "Information about flight delays",
32+
"kind": "badge",
33+
"externalDocs": {
34+
"description": "Delay compensation policies",
35+
"url": "https://docs.example.com/delay-policies"
36+
}
37+
}
38+
],
39+
"paths": {
40+
"/flights": {
41+
"get": {
42+
"tags": ["flights"],
43+
"summary": "List all flights"
44+
}
45+
},
46+
"/flights/international": {
47+
"get": {
48+
"tags": ["international"],
49+
"summary": "List international flights"
50+
}
51+
},
52+
"/flights/domestic": {
53+
"get": {
54+
"tags": ["domestic"],
55+
"summary": "List domestic flights"
56+
}
57+
},
58+
"/flights/delayed": {
59+
"get": {
60+
"tags": ["delays"],
61+
"summary": "Get delayed flights"
62+
}
7263
}
73-
}
64+
}
65+
}

0 commit comments

Comments
 (0)