-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswagger.yaml
174 lines (172 loc) · 4.88 KB
/
swagger.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
swagger: "2.0"
info:
description: "This is the specification of the restful mensa api.
The api provides the csv of dishes served by stwno formatted in json."
version: "1.0.0"
title: "Mensa Restful"
contact:
email: "schicho@fim.uni-passau.de"
host: "mensa-restful.herokuapp.com"
basePath: "/api"
tags:
- name: "simplified"
description: "Easy access to canteen data of your university"
- name: "unix time"
description: "Access canteen data from your university, by specifying the day unix time"
- name: "date"
description: "Access canteen data by specifiying a date YYYY-MM-DD"
schemes:
- "https"
- "http"
paths:
/{university}/today:
get:
tags:
- "simplified"
summary: "Get the dishes served today. Using local time at UTC+1"
parameters:
- name: university
description: "abbreviation of the canteen as used by stwno."
in: path
required: true
type: string
produces:
- "application/json"
responses:
"200":
description: "successful operation"
schema:
type: array
items:
$ref: "#/definitions/Dish"
"400":
description: "invalid university provided"
"500":
description: "invalid CSV from STWNO, could not download data"
/{university}/tommorrow:
get:
tags:
- "simplified"
summary: "Get the dishes served tomorrow. Using local time at UTC+1"
parameters:
- name: university
description: "abbreviation of the canteen as used by stwno."
in: path
required: true
type: string
produces:
- "application/json"
responses:
"200":
description: "successful operation"
schema:
type: array
items:
$ref: "#/definitions/Dish"
"400":
description: "invalid university provided"
"500":
description: "invalid CSV from STWNO, could not download data"
/{university}/week:
get:
tags:
- "simplified"
summary: "Get the dishes served this week. Using local time at UTC+1"
parameters:
- name: university
description: "abbreviation of the canteen as used by stwno."
in: path
required: true
type: string
produces:
- "application/json"
responses:
"200":
description: "successful operation"
schema:
type: array
items:
$ref: "#/definitions/Dish"
"400":
description: "invalid university provided"
"500":
description: "invalid CSV from STWNO, could not download data"
/{university}/timestamp/{timestamp}:
get:
tags:
- "unix time"
summary: "Get the dishes served on the specified day. Using local time at UTC+1"
parameters:
- name: university
description: "abbreviation of the canteen as used by stwno."
in: path
required: true
type: string
- name: timestamp
description: "unix timestamp"
in: path
required: true
type: integer
produces:
- "application/json"
responses:
"200":
description: "successful operation"
schema:
type: array
items:
$ref: "#/definitions/Dish"
"400":
description: "'invalid university provided'"
"404":
description: "'404 page not found' if {timestamp} is not an integer"
"500":
description: "'invalid CSV from STWNO', 'could not download data'"
/{university}/date/{date}:
get:
tags:
- "date"
summary: "Get the dishes served on the specified day. Using local time at UTC+1"
parameters:
- name: university
description: "abbreviation of the canteen as used by stwno."
in: path
required: true
type: string
- name: date
description: "date given as YYYY-MM-DD"
in: path
required: true
type: string
produces:
- "application/json"
responses:
"200":
description: "successful operation"
schema:
type: array
items:
$ref: "#/definitions/Dish"
"400":
description: "'invalid university provided', 'invalid date format. expect YYYY-MM-DD'"
"500":
description: "'invalid CSV from STWNO', 'could not download data'"
definitions:
Dish:
type: "object"
properties:
date:
type: "string"
format: "DD-MM-YYYY"
type:
type: "string"
name:
type: "string"
tags:
type: "string"
price_student:
type: "string"
price_employee:
type: "string"
price_guest:
type: "string"