-
Notifications
You must be signed in to change notification settings - Fork 3
/
swagger.yaml
223 lines (223 loc) · 5.45 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
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
swagger: "2.0"
info:
title: "Getränke Liste"
version: "0.0.1"
description: "The API for the Getränke Liste of the Fachschaft Fakultät 5 Uni Stuttgart"
host: "localhost"
basePath: "/"
tags:
- name: "locale"
description: "Access to the language packs"
- name: "beverage"
description: "Access to all the beverages in the system"
- name: "user"
description: "Access to all the user data"
- name: "history"
description: "Access to the history data"
- name: "order"
description: "Allows the ordering of beverages"
schemes:
- "https"
paths:
/locales:
get:
tags:
- "locale"
summary: "Get a list of all available translations"
produces:
- "application/json"
responses:
200:
description: "Successful operation"
schema:
$ref: "#/definitions/LanguagePacks"
/locales/{localeId}:
get:
tags:
- "locale"
summary: "Get a language pack"
description: "Returns the language pack"
produces:
- "application/json"
parameters:
- name: "localeId"
in: "path"
description: "ID of the language pack to return"
required: true
type: "string"
responses:
200:
description: "Successful operation"
schema:
$ref: "#/definitions/LanguagePack"
404:
description: "Language pack not found"
/beverages:
get:
tags:
- "beverage"
summary: "Get all beverages"
produces:
- "application/json"
responses:
200:
description: "Successful operation"
schema:
$ref: "#/definitions/Beverages"
/users:
get:
tags:
- "user"
summary: "Get all users"
produces:
- "application/json"
responses:
200:
description: "Successful operation"
schema:
$ref: "#/definitions/Users"
/users/{userId}:
get:
tags:
- "user"
summary: "Get a specific user data"
produces:
- "application/json"
parameters:
- name: "userId"
in: "path"
description: "ID of the user to return"
required: true
type: "string"
responses:
200:
description: "Successful operation"
schema:
$ref: "#/definitions/User"
404:
description: "User not found"
/orders:
get:
tags:
- "history"
summary: "Get the global history of all users of an limit of maximum 1000 items"
produces:
- "application/json"
parameters:
- name: "limit"
in: "query"
type: "integer"
format: "int32"
description: "Limit of returned histories"
responses:
200:
description: "Successful operation"
schema:
$ref: "#/definitions/History"
post:
tags:
- "order"
summary: "Order a beverage"
parameters:
- name: "user"
in: "query"
type: "string"
description: "The user that ordered"
- name: "beverage"
in: "query"
type: "string"
description: "The beverage that was chosen"
responses:
200:
description: "OK"
400:
description: "Fail to order the beverage for the user"
/orders/{userId}:
get:
tags:
- "history"
summary: "Get the user history of a limit of maximum 1000 items"
parameters:
- name: "userId"
in: "path"
type: "string"
required: true
description: "User ID of users history"
- name: "limit"
in: "query"
type: "integer"
format: "int32"
description: "Limit of returned histories"
responses:
200:
description: "OK"
schema:
$ref: "#/definitions/History"
404:
description: "User not found"
definitions:
LanguagePack:
type: "object"
properties:
.+:
type: "string"
description: "A Map of technical name to translated string"
LanguagePacks:
type: "array"
items:
type: "object"
properties:
id:
type: "string"
description: "The short language name as id for the pack"
name:
type: "string"
description: "The name of the language which is displayed to the user"
Beverages:
type: "array"
items:
type: "object"
properties:
name:
type: "string"
description: "Name of the beverage"
price:
type: "integer"
format: "int32"
description: "Price of the beverage in euro cents"
Users:
type: "array"
items:
type: "string"
description: "Name of the user"
User:
type: "object"
properties:
name:
type: "string"
description: "Name of the User"
balance:
type: "integer"
format: "int32"
description: "Actual balance of the user"
History:
type: "array"
items:
type: object
properties:
id:
type: "integer"
format: "int32"
user:
type: "string"
description: "Name of the user"
reason:
type: "string"
description: "Reason for the change in money"
amount:
type: "integer"
format: "int32"
description: "Amount of the change in euro cent"
timestamp:
type: "string"
description: "Timestamp in YYYY-MM-DD hh-mm-ss"