-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi-functions.yaml
260 lines (260 loc) · 7.73 KB
/
openapi-functions.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
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
openapi: 3.0.1
info:
version: 1.2.0
title: TopTeamsAPIv3
paths:
/compositions/generate:
post:
summary: returns the best composition(s) from a player list.
parameters:
- name: split_best_players
in: query
description: To separate the two best players in each team
required: false
schema:
type: boolean
default: true
- name: split_worst_players
in: query
description: To separate the two worst players in each team
required: false
schema:
type: boolean
default: true
- name: split_goal_keepers
in: query
description: To seperate the players with the position GK in each team
required: false
schema:
type: boolean
default: true
- name: split_defenders
in: query
description: To seperate the players with the position DEF in each team
required: false
schema:
type: boolean
default: true
- name: split_strikers
in: query
description: To seperate the players with the position ATT in each team
required: false
schema:
type: boolean
default: true
- name: expected_team_number
in: query
description: The number of teams you would like to generate
required: false
schema:
type: integer
format: int64
default: 2
- name: expected_composition_number
in: query
description: The number of compositions you woulk like to generate
required: false
schema:
type: integer
format: int64
default: 1
- name: composition_type
in: query
description: |-
REGULAR : Teams with the same number of players
SUBSTITUTION : Teams with potential substitutes
ODD : teams with potential different number of players playing all at the same time
required: false
schema:
type: string
enum:
- REGULAR
- SUBSTITUTION
- ODD
default: REGULAR
responses:
'200':
description: Composition
requestBody:
content:
application/json:
schema:
type: array
items:
type: object
properties:
id:
type: string
rating:
type: number
position:
type: string
example:
availablePlayers:
- id: player1
rating: 54
position: GK
- id: player2
rating: 77
- id: player3
rating: 59
position: GK
- id: player4
rating: 81
- id: player5
rating: 52
- id: player6
rating: 84
- id: player7
rating: 55
- id: player8
rating: 45
- id: player9
rating: 60
- id: player10
rating: 88
required: true
/games/evaluate:
post:
summary: returns the player rating modifications after a given game
parameters:
- name: score_A
in: query
description: score of Team A
required: true
schema:
type: integer
format: int64
default: 0
- name: score_B
in: query
description: score of Team B
required: true
schema:
type: integer
format: int64
default: 0
- name: relative_distribution
in: query
description: To distribute points between players inversely proportionnaly to the number of matchs they played
required: false
schema:
type: string
enum:
- NONE
- LOW
- MEDIUM
- HIGH
default: MEDIUM
- name: split_points_by_team
in: query
description: To split equally the points between the two teams (if false, the points will be splitted globally using the relative_distribution same logic)
required: false
schema:
type: boolean
default: true
- name: composition_type
in: query
description: |-
type of game
REGULAR : Teams with the same number of players |
SUBSTITUTION : Teams with substitutes |
ODD : teams with different number of players on the pitch
required: false
schema:
type: string
enum:
- REGULAR
- SUBSTITUTION
- ODD
default: REGULAR
- name: kf
in: query
description: multiplier coefficient which will increase or decrease the awarded points. Should be >0
required: false
schema:
type: integer
format: int64
default: 4
responses:
'200':
description: 'Map<String, Double>'
requestBody:
content:
application/json:
schema:
type: object
example:
team_A:
players:
- id: player1
rating: 54
nb_games_played: 31
- id: player2
rating: 77
nb_games_played: 80
- id: player3
rating: 59
nb_games_played: 14
- id: player4
rating: 81
nb_games_played: 27
- id: player5
rating: 52
nb_games_played: 9
team_B:
players:
- id: player6
rating: 84
nb_games_played: 102
- id: player7
rating: 55
nb_games_played: 42
- id: player8
rating: 45
nb_games_played: 77
- id: player9
rating: 60
nb_games_played: 12
- id: player10
rating: 88
nb_games_played: 92
required: true
servers:
- url: 'https://top-teams-api-cloud-run-vk77dlpuhq-ew.a.run.app'
components:
schemas:
Player:
properties:
id:
description: id of the player
type: string
rating:
description: rating of the player (between 0 & 100)
type: number
nb_games_played:
description: number of games played (>=0)
type: number
position:
description: position of the player (GK, DEF, or ATT)
type: string
Team:
properties:
players:
description: List of team players
type: array
items:
$ref: '#/components/schemas/Player'
Composition:
properties:
available_players:
description: List of team players
type: array
items:
$ref: '#/components/schemas/Player'
team_A:
description: teamA
$ref: '#/components/schemas/Team'
team_B:
description: teamB
$ref: '#/components/schemas/Team'