forked from srehwald/eat-api
-
Notifications
You must be signed in to change notification settings - Fork 14
/
openapi.yml
367 lines (367 loc) · 10.7 KB
/
openapi.yml
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
openapi: 3.0.1
info:
title: eat-api
version: '2.1'
description: Simple static API for some (student) food places in Munich.
servers:
- url: https://tum-dev.github.io/eat-api/{language}
variables:
language:
description: For localization the base path may have to be extended by the language.
default: ''
enum:
- ''
- 'en/'
paths:
/{canteen_id}/{year}/{week}.json:
get:
summary: Get a menu for the specified canteen, year and week
parameters:
- name: canteen_id
in: path
description: ID of the canteen
required: true
schema:
$ref: '#/components/schemas/Canteen/properties/canteen_id'
- name: year
in: path
description: Year of the menu to get
required: true
schema:
type: integer
example: 2022
- name: week
in: path
description: Week of the menu to get with two digits
required: true
schema:
type: string
pattern: ^\d{2}$
example: '02'
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/Week'
'404':
description: no menu found for specified options
tags:
- menu
/{canteen_id}/combined/combined.json:
get:
summary: To get all menus for one specific canteen
parameters:
- name: canteen_id
in: path
description: ID of the canteen
required: true
schema:
$ref: '#/components/schemas/Canteen/properties/canteen_id'
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/CanteenMenu'
'404':
description: no menu found for the given canteen
tags:
- menu
/all.json:
get:
summary: To get all menus for all canteens
responses:
'200':
description: successful operation
content:
application/json:
schema:
type: object
properties:
canteens:
type: array
items:
$ref: '#/components/schemas/CanteenMenu'
tags:
- menu
/all_ref.json:
get:
deprecated: true
summary: To get all menus that are not older than one day for all canteens
description:
Here dish_type is also normalized. All tailing digits and spaces get
removed from dish_type. For example Tagesgericht 1 -> Tagesgericht and
Aktionsessen 6 -> Aktionsessen. Also ignores all menus older than one
day. This results in this file being usually half the size of the
all.json file.
This is currently deprecated, and only supported in the german language.
responses:
'200':
description: successful operation
content:
application/json:
schema:
type: array
items:
type: object
properties:
canteen_id:
$ref: '#/components/schemas/Canteen/properties/canteen_id'
dishes:
type: array
items:
allOf:
- $ref: '#/components/schemas/Dish'
- properties:
date:
type: string
format: date
tags:
- menu
/enums/canteens.json:
get:
summary: To get all available canteens
responses:
'200':
description: successful operation
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Canteen'
tags:
- static
/enums/languages.json:
get:
summary: To get all available languages
responses:
'200':
description: successful operation
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Language'
tags:
- static
/enums/labels.json:
get:
summary: To get all available labels
responses:
'200':
description: successful operation
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Label'
tags:
- static
components:
schemas:
Canteen:
type: object
description: Information about a canteen
properties:
enum_name:
type: string
description: Internal identifier for a canteen
example: MENSA_GARCHING
name:
type: string
description: Readable name for a canteen
example: Mensa Garching
location:
$ref: '#/components/schemas/Location'
canteen_id:
type: string
description: Identifier for the canteen, as it has to be used for accessing data.
example: mensa-garching
queue_status:
type: string
description:
URL to another API, where data about the queue length of the canteen
can be accessed. Is null, when not available.
example: https://mensa.liste.party/api/
open_hours:
$ref: '#/components/schemas/OpenHoursWeek'
OpenHoursWeek:
type: object
description: Specifies the opening hours for a whole working week (mon-fri)
properties:
mon:
$ref: '#/components/schemas/OpenHoursDay'
tue:
$ref: '#/components/schemas/OpenHoursDay'
wed:
$ref: '#/components/schemas/OpenHoursDay'
thu:
$ref: '#/components/schemas/OpenHoursDay'
fri:
$ref: '#/components/schemas/OpenHoursDay'
OpenHoursDay:
type: object
description: Specifies, a time range for opening hours. The times always have the format
properties:
start:
type: string
pattern: '^\d{2}:\d{2}'
example: 11:00
end:
type: string
pattern: '^\d{2}:\d{2}'
example: 14:00
Location:
type: object
description: A location description including the readable address and coordinates
properties:
address:
type: string
description: Readable address consisting of street, house number and city
example: Boltzmannstraße 19, Garching
latitude:
type: number
example: 48.268132
longitude:
type: number
example: 11.672263
Language:
type: object
description: A language, that is supported by the API
properties:
name:
type: string
description: Identifier of the language
example: EN
base_url:
type: string
description:
Additional base path that is appended to the base url, in order to
access data for this language. Due to backwards compatibility resons the base_url for german is an empty string.
example: 'en/'
label:
type: string
description: Readable name of the language in the given language
example: English
flag:
type: string
description: Emoji flag symbol for the language
example: 🏴
Label:
type: object
description: Allergene and ingredient information
properties:
enum_name:
type: string
example: VEGETARIAN
text:
type: object
description:
Key-value object containing readable labels. The language is given
in the key, and is referred to to the name from the language.
additionalProperties:
type: string
example:
DE: Vegetarisch
EN: vegetarian
abbreviation:
type: string
description: Emoji symbol or short form of a label
example: 🌽
CanteenMenu:
type: object
description: All dishes for a specific canteen
properties:
version:
type: string
example: '2.1'
canteen_id:
$ref: '#/components/schemas/Canteen/properties/canteen_id'
weeks:
type: array
items:
$ref: '#/components/schemas/Week'
Week:
type: object
description: All dishes for all days during one week
properties:
number:
type: integer
description: Week number
example: 2
year:
type: integer
example: 2022
days:
type: array
items:
$ref: '#/components/schemas/Day'
Day:
type: object
description: All dishes for one day
properties:
date:
type: string
format: date
dishes:
type: array
items:
$ref: '#/components/schemas/Dish'
Dish:
type: object
description: Describes one dish
properties:
name:
type: string
description: Title of the dish
example: Pasta all'arrabiata
prices:
$ref: '#/components/schemas/Prices'
labels:
type: array
items:
$ref: '#/components/schemas/Label/properties/enum_name'
dish_type:
type: string
example: Pasta
Prices:
type: object
properties:
students:
allOf:
- $ref: '#/components/schemas/Price'
- description: Price that students pay
staff:
allOf:
- $ref: '#/components/schemas/Price'
- description: Price that staff pays
guests:
allOf:
- $ref: '#/components/schemas/Price'
- description: Price that guests pay
Price:
type: object
properties:
base_price:
type: number
description: Base price of a dish
example: 0
price_per_unit:
type: number
description: Price per unit as given
example: 0.75
unit:
type: string
description: The unit used for calculating the price
example: 100g
tags:
- name: menu
description: Get information about dish plans
- name: static
description: Static information regarding canteens, labels and languages