@@ -2,10 +2,19 @@ openapi: 3.0.3
2
2
info :
3
3
title : ITMO Dating Matchmaker
4
4
version : 0.0.1
5
+ description : Service is responsible for issuing recommendations.
6
+ contact :
7
+ name : ITMO Dating Team
8
+ url : https://github.com/secs-dev/itmo-dating/issues
5
9
servers :
6
- - url : /api/v1
10
+ - url : /api
11
+ x-internal : true
7
12
security :
8
13
- bearerAuth : [USER, ADMIN]
14
+ tags :
15
+ - name : Monitoring
16
+ - name : Suggestions
17
+ - name : Statistics
9
18
paths :
10
19
/monitoring/healthcheck :
11
20
get :
@@ -14,16 +23,18 @@ paths:
14
23
description : Returns 'ok', if service is alive, else we will cry
15
24
security : []
16
25
responses :
17
- 200 :
26
+ " 200 " :
18
27
description : OK
19
28
content :
20
29
text/html :
21
30
schema :
22
31
type : string
32
+ pattern : ^[a-z]+$
33
+ maxLength : 32
23
34
example : ok
24
- 500 :
35
+ " 500 " :
25
36
$ref : " #/components/responses/500"
26
- 503 :
37
+ " 503 " :
27
38
$ref : " #/components/responses/503"
28
39
default :
29
40
$ref : " #/components/responses/Unexpected"
@@ -45,19 +56,22 @@ paths:
45
56
maximum : 50
46
57
example : 8
47
58
responses :
48
- 200 :
59
+ " 200 " :
49
60
description : OK
50
61
content :
51
62
application/json :
52
63
schema :
53
64
type : array
54
65
items :
55
66
$ref : " #/components/schemas/PersonId"
56
- 401 :
67
+ maxItems : 50
68
+ " 400 " :
69
+ $ref : " #/components/responses/400"
70
+ " 401 " :
57
71
$ref : " #/components/responses/401"
58
- 500 :
72
+ " 500 " :
59
73
$ref : " #/components/responses/500"
60
- 503 :
74
+ " 503 " :
61
75
$ref : " #/components/responses/503"
62
76
default :
63
77
$ref : " #/components/responses/Unexpected"
@@ -76,25 +90,27 @@ paths:
76
90
schema :
77
91
$ref : " #/components/schemas/AttitudeKind"
78
92
responses :
79
- 204 :
93
+ " 204 " :
80
94
description : Attitude was taken into account
81
- 401 :
95
+ " 400 " :
96
+ $ref : " #/components/responses/400"
97
+ " 401 " :
82
98
$ref : " #/components/responses/401"
83
- 404 :
99
+ " 404 " :
84
100
description : Person is not found
85
101
content :
86
102
application/json :
87
103
schema :
88
104
$ref : " #/components/schemas/GeneralError"
89
- 409 :
105
+ " 409 " :
90
106
description : Attitude was already taken
91
107
content :
92
108
application/json :
93
109
schema :
94
110
$ref : " #/components/schemas/GeneralError"
95
- 500 :
111
+ " 500 " :
96
112
$ref : " #/components/responses/500"
97
- 503 :
113
+ " 503 " :
98
114
$ref : " #/components/responses/503"
99
115
default :
100
116
$ref : " #/components/responses/Unexpected"
@@ -112,19 +128,21 @@ paths:
112
128
schema :
113
129
$ref : " #/components/schemas/PersonId"
114
130
responses :
115
- 204 :
131
+ " 204 " :
116
132
description : Attitudes was reset
117
- 401 :
133
+ " 400 " :
134
+ $ref : " #/components/responses/400"
135
+ " 401 " :
118
136
$ref : " #/components/responses/401"
119
- 404 :
137
+ " 404 " :
120
138
description : Person is not found
121
139
content :
122
140
application/json :
123
141
schema :
124
142
$ref : " #/components/schemas/GeneralError"
125
- 500 :
143
+ " 500 " :
126
144
$ref : " #/components/responses/500"
127
- 503 :
145
+ " 503 " :
128
146
$ref : " #/components/responses/503"
129
147
default :
130
148
$ref : " #/components/responses/Unexpected"
@@ -136,27 +154,30 @@ paths:
136
154
parameters :
137
155
- $ref : " #/components/parameters/PersonIdPath"
138
156
responses :
139
- 200 :
157
+ " 200 " :
140
158
description : OK
141
159
content :
142
160
application/json :
143
161
schema :
144
162
type : array
145
163
items :
146
164
$ref : " #/components/schemas/PersonId"
147
- 401 :
165
+ maxItems : 10000
166
+ " 400 " :
167
+ $ref : " #/components/responses/400"
168
+ " 401 " :
148
169
$ref : " #/components/responses/401"
149
- 403 :
170
+ " 403 " :
150
171
$ref : " #/components/responses/403"
151
- 404 :
172
+ " 404 " :
152
173
description : Person is not found. Error is available only with admin rights
153
174
content :
154
175
application/json :
155
176
schema :
156
177
$ref : " #/components/schemas/GeneralError"
157
- 500 :
178
+ " 500 " :
158
179
$ref : " #/components/responses/500"
159
- 503 :
180
+ " 503 " :
160
181
$ref : " #/components/responses/503"
161
182
default :
162
183
$ref : " #/components/responses/Unexpected"
@@ -168,7 +189,7 @@ paths:
168
189
security :
169
190
- bearerAuth : [ADMIN]
170
191
responses :
171
- 200 :
192
+ " 200 " :
172
193
description : OK
173
194
content :
174
195
application/json :
@@ -184,22 +205,27 @@ paths:
184
205
description : Count of people liked by the person
185
206
format : int32
186
207
minimum : 0
208
+ maximum : 10000000
187
209
skips :
188
210
type : integer
189
211
description : Count of people skipped by the person
190
212
format : int32
191
213
minimum : 0
214
+ maximum : 10000000
192
215
required :
193
216
- personId
194
217
- likes
195
218
- skips
196
- 401 :
219
+ maxItems : 10000
220
+ " 400 " :
221
+ $ref : " #/components/responses/400"
222
+ " 401 " :
197
223
$ref : " #/components/responses/401"
198
- 403 :
224
+ " 403 " :
199
225
$ref : " #/components/responses/403"
200
- 500 :
226
+ " 500 " :
201
227
$ref : " #/components/responses/500"
202
- 503 :
228
+ " 503 " :
203
229
$ref : " #/components/responses/503"
204
230
default :
205
231
$ref : " #/components/responses/Unexpected"
@@ -209,6 +235,7 @@ components:
209
235
type : http
210
236
scheme : bearer
211
237
bearerFormat : JWT
238
+ description : Supports RFC8725
212
239
parameters :
213
240
PersonIdPath :
214
241
name : person_id
@@ -222,44 +249,40 @@ components:
222
249
description : A unique key of a person, autogenerated
223
250
format : int64
224
251
minimum : 1
225
- example : 12345678
252
+ maximum : 10000000
253
+ example : 1234567
226
254
AttitudeKind :
227
255
type : string
228
256
enum :
229
257
- like
230
258
- skip
231
- Attitude :
232
- type : object
233
- properties :
234
- kind :
235
- $ref : " #/components/schemas/AttitudeKind"
236
- required :
237
- - verdict
238
259
GeneralError :
239
260
type : object
240
261
properties :
241
262
code :
242
263
type : integer
243
264
format : int32
244
265
description : HTTP Status Code
266
+ minimum : 100
267
+ maximum : 600
245
268
example : 400
246
269
status :
247
270
type : string
248
271
description : HTTP Status Description
272
+ pattern : ^[A-Za-z0-9 .,'-]+$
273
+ maxLength : 64
249
274
example : Bad Request
250
275
message :
251
276
type : string
252
277
description : Detailed Message
278
+ pattern : ^[A-Za-z0-9 .,'-]+$
279
+ maxLength : 128
253
280
example : Username must contain only latin letter
254
281
required :
255
282
- code
256
283
- status
257
284
- message
258
285
responses :
259
- " 200 " :
260
- description : OK
261
- " 204 " :
262
- description : No Content
263
286
" 400 " :
264
287
description : Invalid arguments
265
288
content :
@@ -278,18 +301,6 @@ components:
278
301
application/json :
279
302
schema :
280
303
$ref : " #/components/schemas/GeneralError"
281
- " 404 " :
282
- description : Not found
283
- content :
284
- application/json :
285
- schema :
286
- $ref : " #/components/schemas/GeneralError"
287
- " 409 " :
288
- description : Duplicate request causing a conflict
289
- content :
290
- application/json :
291
- schema :
292
- $ref : " #/components/schemas/GeneralError"
293
304
" 500 " :
294
305
description : Internal server error
295
306
content :
0 commit comments