-
Notifications
You must be signed in to change notification settings - Fork 6
/
todo-list-with-id.yaml
431 lines (430 loc) · 11.5 KB
/
todo-list-with-id.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
swagger: '2.0'
info:
title: Todo List API
version: initial
consumes:
- application/json
produces:
- application/json
- text/html
x-interfaces:
Item: &Item
get:
description: Retrieve an Item
parameters:
- $ref: '#/parameters/Accept'
responses:
'200':
description: successful
headers:
Content-Location:
description: perma-link URL of resource
type: string
Content-Type:
description: The media type of the returned body
type: string
ETag:
description: this value must be echoed in the If-Match header of every
PATCH or PUT
type: string
schema:
$ref: '#/definitions/Item'
'401':
$ref: '#/responses/401'
'403':
$ref: '#/responses/403'
'404':
$ref: '#/responses/404'
'406':
$ref: '#/responses/406'
default:
$ref: '#/responses/default'
patch:
consumes:
- application/merge-patch+json
description: Update an Item entity
parameters:
- $ref: '#/parameters/If-Match'
- description: The subset of properties of the Item being updated
in: body
name: body
required: true
schema:
$ref: '#/definitions/Item'
responses:
'200':
description: successful
headers:
Content-Location:
description: perma-link URL of resource
type: string
Content-Type:
description: The media type of the returned body
type: string
ETag:
description: this value must be echoed in the If-Match header of every
PATCH or PUT
type: string
schema:
$ref: '#/definitions/Item'
'400':
$ref: '#/responses/400'
'401':
$ref: '#/responses/401'
'403':
$ref: '#/responses/403'
'404':
$ref: '#/responses/404'
'406':
$ref: '#/responses/406'
'409':
$ref: '#/responses/409'
default:
$ref: '#/responses/default'
delete:
description: Delete an Item
responses:
'200':
description: successful
headers:
Content-Location:
description: perma-link URL of resource
type: string
Content-Type:
description: The media type of the returned body
type: string
ETag:
description: this value must be echoed in the If-Match header of every
PATCH or PUT
type: string
schema:
$ref: '#/definitions/Item'
'400':
$ref: '#/responses/400'
'401':
$ref: '#/responses/401'
'403':
$ref: '#/responses/403'
'404':
$ref: '#/responses/404'
'406':
$ref: '#/responses/406'
default:
$ref: '#/responses/default'
head:
description: retrieve HEAD
responses:
'200':
$ref: '#/responses/standard_200'
'401':
$ref: '#/responses/401'
'403':
$ref: '#/responses/403'
'404':
$ref: '#/responses/404'
default:
$ref: '#/responses/default'
options:
description: Retrieve OPTIONS
parameters:
- $ref: '#/parameters/Access-Control-Request-Method'
- $ref: '#/parameters/Access-Control-Request-Headers'
responses:
'200':
$ref: '#/responses/options_200'
'401':
$ref: '#/responses/401'
'403':
$ref: '#/responses/403'
'404':
$ref: '#/responses/404'
default:
$ref: '#/responses/default'
x-id: Item
TodoList:
get:
description: Retrieve a TodoList
parameters:
- $ref: '#/parameters/Accept'
responses:
'200':
description: successful
headers:
Content-Location:
description: perma-link URL of resource
type: string
Content-Type:
description: The media type of the returned body
type: string
ETag:
description: this value must be echoed in the If-Match header of every
PATCH or PUT
type: string
schema:
$ref: '#/definitions/TodoList'
'401':
$ref: '#/responses/401'
'403':
$ref: '#/responses/403'
'404':
$ref: '#/responses/404'
'406':
$ref: '#/responses/406'
default:
$ref: '#/responses/default'
head:
description: retrieve HEAD
responses:
'200':
$ref: '#/responses/standard_200'
'401':
$ref: '#/responses/401'
'403':
$ref: '#/responses/403'
'404':
$ref: '#/responses/404'
default:
$ref: '#/responses/default'
options:
description: Retrieve OPTIONS
parameters:
- $ref: '#/parameters/Access-Control-Request-Method'
- $ref: '#/parameters/Access-Control-Request-Headers'
responses:
'200':
$ref: '#/responses/options_200'
'401':
$ref: '#/responses/401'
'403':
$ref: '#/responses/403'
'404':
$ref: '#/responses/404'
default:
$ref: '#/responses/default'
x-id: TodoList
TodoList.todos:
get:
responses:
'200':
description: description
headers:
Content-Location:
description: perma-link URL of collection
type: string
Content-Type:
description: The media type of the returned body
type: string
schema:
$ref: '#/definitions/Collection'
'303':
$ref: '#/responses/303'
'401':
$ref: '#/responses/401'
'403':
$ref: '#/responses/403'
'404':
$ref: '#/responses/404'
'406':
$ref: '#/responses/406'
default:
$ref: '#/responses/default'
post:
description: Create a new Item
parameters:
- description: The representation of the new Item being created
in: body
name: body
required: true
schema:
$ref: '#/definitions/Item'
- description: The media type of the body
in: header
name: Content-Type
required: true
type: string
responses:
'201':
description: Created new Item
headers:
Content-Type:
description: The media type of the returned body
type: string
ETag:
description: Value of ETag required for subsequent updates
type: string
Location:
description: perma-link URL of newly-created Item
type: string
schema:
$ref: '#/definitions/Item'
'400':
$ref: '#/responses/400'
'401':
$ref: '#/responses/401'
'403':
$ref: '#/responses/403'
'404':
$ref: '#/responses/404'
'406':
$ref: '#/responses/406'
default:
$ref: '#/responses/default'
head:
description: Retrieve HEAD
responses:
'200':
$ref: '#/responses/standard_200'
'401':
$ref: '#/responses/401'
'403':
$ref: '#/responses/403'
'404':
$ref: '#/responses/404'
default:
$ref: '#/responses/default'
options:
description: Retrieve OPTIONS
parameters:
- $ref: '#/parameters/Access-Control-Request-Method'
- $ref: '#/parameters/Access-Control-Request-Headers'
responses:
'200':
$ref: '#/responses/options_200'
'401':
$ref: '#/responses/401'
'403':
$ref: '#/responses/403'
'404':
$ref: '#/responses/404'
default:
$ref: '#/responses/default'
x-id: TodoList.todos
x-templates:
'{TodoList-URL}':
$ref: '#/x-interfaces/TodoList'
'{TodoList-URL}/todos':
$ref: '#/x-interfaces/TodoList.todos'
'{TodoList-URL}/todos/{id}':
parameters:
- in: path
name: id
required: true
type: string
<<: *Item
paths:
/:
$ref: '#/x-templates/{TodoList-URL}'
/todos:
$ref: '#/x-templates/{TodoList-URL}~1todos'
/todos/{id}:
$ref: '#/x-templates/{TodoList-URL}~1todos~1{id}'
definitions:
TodoList:
readOnly: true
properties:
todos:
type: string
format: uri
x-interface: '#/x-interfaces/TodoList.todos'
x-interface: '#/x-interfaces/TodoList'
Item:
properties:
id:
type: string
readOnly: true
description:
type: string
due:
type: string
format: date-time
x-interface: '#/x-interfaces/Item'
Collection:
readOnly: true
properties:
contents:
type: array
items:
$ref: '#/definitions/Item'
parameters:
Accept:
description: specifies the requested media type - required
in: header
name: Accept
required: true
type: string
Access-Control-Request-Headers:
description: specifies the custom headers the client wishes to use
in: header
name: Access-Control-Request-Headers
required: true
type: string
Access-Control-Request-Method:
description: specifies the method the client wishes to use
in: header
name: Access-Control-Request-Method
required: true
type: string
If-Match:
description: specifies the last known ETag value of the resource being modified
in: header
name: If-Match
required: true
type: string
responses:
'303':
description: See other. Server is redirecting client to a different resource
headers:
Location:
description: URL of other resource
type: string
'400':
description: Bad Request. Client request in error
schema: {}
'401':
description: Unauthorized. Client authentication token missing from request
schema: {}
'403':
description: Forbidden. Client authentication token does not permit this method
on this resource
schema: {}
'404':
description: Not Found. Resource not found
schema: {}
'406':
description: Not Acceptable. Requested media type not available
schema: {}
'409':
description: Conflict. Value provided in If-Match header does not match current
ETag value of resource
schema: {}
default:
description: 5xx errors and other stuff
schema: {}
options_200:
description: successful
headers:
Access-Control-Allow-Headers:
description: headers allowed
type: string
Access-Control-Allow-Methods:
description: methods allowed
type: string
Access-Control-Allow-Origin:
description: origins allowed
type: string
Access-Control-Max-Age:
description: length of time response can be cached
type: string
standard_200:
description: successful
headers:
Content-Location:
description: perma-link URL of resource
type: string
Content-Type:
description: The media type of the returned body
type: string
ETag:
description: this value must be echoed in the If-Match header of every PATCH
or PUT
type: string