forked from CircleCI-Public/sample-python-cfd
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
335 lines (335 loc) · 8.68 KB
/
openapi.yaml
File metadata and controls
335 lines (335 loc) · 8.68 KB
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
openapi: 3.0.0
info:
license:
name: MIT
title: Continous Food Delievery
version: 1.0.0
servers:
- description: Local
url: http://localhost:8080/CFD/1.0.0
paths:
/cart:
get:
operationId: list_cart
parameters:
- description: How many items to return at one time (max 100)
explode: true
in: query
name: limit
required: false
schema:
format: int32
type: integer
style: form
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/Cart'
description: A paged array of cart items
headers:
x-next:
description: A link to the next page of responses
explode: false
schema:
type: string
style: simple
default:
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: unexpected error
summary: List all cart items
tags:
- cart
x-openapi-router-controller: openapi_server.controllers.cart_controller
post:
description: Creates a new item in the cart. Duplicates are allowed
operationId: add_cart_item
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/MenuItem'
description: Item to add to the cart
required: true
responses:
"201":
description: Null response
default:
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: unexpected error
summary: Add a menu item a cart
tags:
- cart
x-openapi-router-controller: openapi_server.controllers.cart_controller
/cart/{itemId}:
delete:
description: |
The item must be in the cart. If multiple of same item, call this twice
operationId: delete_cart_item
parameters:
- description: The menu item to delete from cart
explode: false
in: path
name: itemId
required: true
schema:
format: int32
type: integer
style: simple
responses:
"201":
description: Null response
default:
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: unexpected error
summary: Remove item from cart
tags:
- cart
x-openapi-router-controller: openapi_server.controllers.cart_controller
/image:
post:
description: Creates an image. Duplicates are allowed. Returns the image id
operationId: add_image
requestBody:
$ref: '#/components/requestBodies/inline_object'
content:
multipart/form-data:
schema:
properties:
fileName:
format: binary
type: string
type: object
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/inline_response_200'
description: OK
summary: Add an image to the restaraunt
tags:
- image
x-openapi-router-controller: openapi_server.controllers.image_controller
/image/{imageId}:
delete:
description: |
The imageId must exist
operationId: delete_image
parameters:
- description: The imageId to delete
explode: false
in: path
name: imageId
required: true
schema:
format: int32
type: integer
style: simple
responses:
"201":
description: Null response
default:
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: unexpected error
summary: Remove image
tags:
- image
x-openapi-router-controller: openapi_server.controllers.image_controller
get:
description: |
Returns the image as image/png
operationId: get_image
parameters:
- description: The imageId of the image to retrieve
explode: false
in: path
name: imageId
required: true
schema:
format: int32
type: integer
style: simple
responses:
"200":
content:
image/png:
schema:
format: binary
type: string
description: image
summary: Get image
tags:
- image
x-openapi-router-controller: openapi_server.controllers.image_controller
/menu:
get:
operationId: list_menu
parameters:
- description: How many items to return at one time (max 100)
explode: true
in: query
name: limit
required: false
schema:
format: int32
type: integer
style: form
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/Menu'
description: A paged array of menu items
headers:
x-next:
description: A link to the next page of responses
explode: false
schema:
type: string
style: simple
default:
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: unexpected error
summary: List all menu items
tags:
- menu
x-openapi-router-controller: openapi_server.controllers.menu_controller
post:
description: Creates a new item in the menu. Duplicates are allowed
operationId: add_menu_item
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/MenuItem'
description: Item to add to the store
required: true
responses:
"201":
description: Null response
default:
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: unexpected error
summary: Create a menu item
tags:
- menu
x-openapi-router-controller: openapi_server.controllers.menu_controller
/menu/{itemId}:
get:
operationId: show_menu_item_by_id
parameters:
- description: The id of the menu item to retrieve
explode: false
in: path
name: itemId
required: true
schema:
type: string
style: simple
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/MenuItem'
description: Expected response to a valid request
default:
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
description: unexpected error
summary: Info for a specific menu item
tags:
- menu
x-openapi-router-controller: openapi_server.controllers.menu_controller
components:
requestBodies:
inline_object:
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/inline_object'
schemas:
MenuItem:
example:
imageId: 1
price: 6.027456183070403
name: name
description: description
id: 0
properties:
id:
format: int32
type: integer
description:
type: string
name:
type: string
price:
type: number
imageId:
description: "URL to an image of the menu item. \nThis should be the image\
\ from the /image endpoint\n"
format: int32
type: integer
required:
- description
- id
- imageId
- name
- price
type: object
Menu:
items:
$ref: '#/components/schemas/MenuItem'
type: array
Cart:
items:
$ref: '#/components/schemas/MenuItem'
type: array
Error:
properties:
code:
format: int32
type: integer
message:
type: string
required:
- code
- message
type: object
inline_object:
properties:
fileName:
format: binary
type: string
type: object
inline_response_200:
example:
imageId: 1
properties:
imageId:
type: integer
type: object