diff options
Diffstat (limited to 'docs/swagger.yaml')
| -rw-r--r-- | docs/swagger.yaml | 148 |
1 files changed, 143 insertions, 5 deletions
diff --git a/docs/swagger.yaml b/docs/swagger.yaml index f719008..fa1a26d 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml | |||
| @@ -1,5 +1,37 @@ | |||
| 1 | basePath: /v1 | 1 | basePath: /v1 |
| 2 | definitions: | 2 | definitions: |
| 3 | models.Chapter: | ||
| 4 | properties: | ||
| 5 | id: | ||
| 6 | type: integer | ||
| 7 | name: | ||
| 8 | type: string | ||
| 9 | type: object | ||
| 10 | models.ChapterMapsResponse: | ||
| 11 | properties: | ||
| 12 | chapter: | ||
| 13 | $ref: '#/definitions/models.Chapter' | ||
| 14 | maps: | ||
| 15 | items: | ||
| 16 | $ref: '#/definitions/models.MapShort' | ||
| 17 | type: array | ||
| 18 | type: object | ||
| 19 | models.ChaptersResponse: | ||
| 20 | properties: | ||
| 21 | chapters: | ||
| 22 | items: | ||
| 23 | $ref: '#/definitions/models.Chapter' | ||
| 24 | type: array | ||
| 25 | game: | ||
| 26 | $ref: '#/definitions/models.Game' | ||
| 27 | type: object | ||
| 28 | models.Game: | ||
| 29 | properties: | ||
| 30 | id: | ||
| 31 | type: integer | ||
| 32 | name: | ||
| 33 | type: string | ||
| 34 | type: object | ||
| 3 | models.LoginResponse: | 35 | models.LoginResponse: |
| 4 | properties: | 36 | properties: |
| 5 | token: | 37 | token: |
| @@ -41,6 +73,13 @@ definitions: | |||
| 41 | properties: | 73 | properties: |
| 42 | records: {} | 74 | records: {} |
| 43 | type: object | 75 | type: object |
| 76 | models.MapShort: | ||
| 77 | properties: | ||
| 78 | id: | ||
| 79 | type: integer | ||
| 80 | name: | ||
| 81 | type: string | ||
| 82 | type: object | ||
| 44 | models.MapSummary: | 83 | models.MapSummary: |
| 45 | properties: | 84 | properties: |
| 46 | category_scores: | 85 | category_scores: |
| @@ -122,6 +161,27 @@ definitions: | |||
| 122 | type: integer | 161 | type: integer |
| 123 | records: {} | 162 | records: {} |
| 124 | type: object | 163 | type: object |
| 164 | models.SearchResponse: | ||
| 165 | properties: | ||
| 166 | maps: | ||
| 167 | items: | ||
| 168 | properties: | ||
| 169 | id: | ||
| 170 | type: integer | ||
| 171 | name: | ||
| 172 | type: string | ||
| 173 | type: object | ||
| 174 | type: array | ||
| 175 | players: | ||
| 176 | items: | ||
| 177 | properties: | ||
| 178 | steam_id: | ||
| 179 | type: string | ||
| 180 | user_name: | ||
| 181 | type: string | ||
| 182 | type: object | ||
| 183 | type: array | ||
| 184 | type: object | ||
| 125 | models.UserRanking: | 185 | models.UserRanking: |
| 126 | properties: | 186 | properties: |
| 127 | total_score: | 187 | total_score: |
| @@ -141,6 +201,33 @@ info: | |||
| 141 | title: Least Portals Database API | 201 | title: Least Portals Database API |
| 142 | version: "1.0" | 202 | version: "1.0" |
| 143 | paths: | 203 | paths: |
| 204 | /chapters/{id}: | ||
| 205 | get: | ||
| 206 | parameters: | ||
| 207 | - description: Chapter ID | ||
| 208 | in: path | ||
| 209 | name: id | ||
| 210 | required: true | ||
| 211 | type: integer | ||
| 212 | produces: | ||
| 213 | - application/json | ||
| 214 | responses: | ||
| 215 | "200": | ||
| 216 | description: OK | ||
| 217 | schema: | ||
| 218 | allOf: | ||
| 219 | - $ref: '#/definitions/models.Response' | ||
| 220 | - properties: | ||
| 221 | data: | ||
| 222 | $ref: '#/definitions/models.ChapterMapsResponse' | ||
| 223 | type: object | ||
| 224 | "400": | ||
| 225 | description: Bad Request | ||
| 226 | schema: | ||
| 227 | $ref: '#/definitions/models.Response' | ||
| 228 | summary: Get maps from the specified chapter id. | ||
| 229 | tags: | ||
| 230 | - games & chapters | ||
| 144 | /demo: | 231 | /demo: |
| 145 | get: | 232 | get: |
| 146 | produces: | 233 | produces: |
| @@ -186,6 +273,56 @@ paths: | |||
| 186 | summary: Get demo with specified demo uuid. | 273 | summary: Get demo with specified demo uuid. |
| 187 | tags: | 274 | tags: |
| 188 | - demo | 275 | - demo |
| 276 | /games: | ||
| 277 | get: | ||
| 278 | produces: | ||
| 279 | - application/json | ||
| 280 | responses: | ||
| 281 | "200": | ||
| 282 | description: OK | ||
| 283 | schema: | ||
| 284 | allOf: | ||
| 285 | - $ref: '#/definitions/models.Response' | ||
| 286 | - properties: | ||
| 287 | data: | ||
| 288 | items: | ||
| 289 | $ref: '#/definitions/models.Game' | ||
| 290 | type: array | ||
| 291 | type: object | ||
| 292 | "400": | ||
| 293 | description: Bad Request | ||
| 294 | schema: | ||
| 295 | $ref: '#/definitions/models.Response' | ||
| 296 | summary: Get games from the leaderboards. | ||
| 297 | tags: | ||
| 298 | - games & chapters | ||
| 299 | /games/{id}: | ||
| 300 | get: | ||
| 301 | parameters: | ||
| 302 | - description: Game ID | ||
| 303 | in: path | ||
| 304 | name: id | ||
| 305 | required: true | ||
| 306 | type: integer | ||
| 307 | produces: | ||
| 308 | - application/json | ||
| 309 | responses: | ||
| 310 | "200": | ||
| 311 | description: OK | ||
| 312 | schema: | ||
| 313 | allOf: | ||
| 314 | - $ref: '#/definitions/models.Response' | ||
| 315 | - properties: | ||
| 316 | data: | ||
| 317 | $ref: '#/definitions/models.ChaptersResponse' | ||
| 318 | type: object | ||
| 319 | "400": | ||
| 320 | description: Bad Request | ||
| 321 | schema: | ||
| 322 | $ref: '#/definitions/models.Response' | ||
| 323 | summary: Get chapters from the specified game id. | ||
| 324 | tags: | ||
| 325 | - games & chapters | ||
| 189 | /login: | 326 | /login: |
| 190 | get: | 327 | get: |
| 191 | consumes: | 328 | consumes: |
| @@ -211,8 +348,6 @@ paths: | |||
| 211 | - login | 348 | - login |
| 212 | /maps/{id}/leaderboards: | 349 | /maps/{id}/leaderboards: |
| 213 | get: | 350 | get: |
| 214 | consumes: | ||
| 215 | - application/json | ||
| 216 | parameters: | 351 | parameters: |
| 217 | - description: Map ID | 352 | - description: Map ID |
| 218 | in: path | 353 | in: path |
| @@ -305,8 +440,6 @@ paths: | |||
| 305 | - maps | 440 | - maps |
| 306 | /maps/{id}/summary: | 441 | /maps/{id}/summary: |
| 307 | get: | 442 | get: |
| 308 | consumes: | ||
| 309 | - application/json | ||
| 310 | parameters: | 443 | parameters: |
| 311 | - description: Map ID | 444 | - description: Map ID |
| 312 | in: path | 445 | in: path |
| @@ -447,7 +580,12 @@ paths: | |||
| 447 | "200": | 580 | "200": |
| 448 | description: OK | 581 | description: OK |
| 449 | schema: | 582 | schema: |
| 450 | $ref: '#/definitions/models.Response' | 583 | allOf: |
| 584 | - $ref: '#/definitions/models.Response' | ||
| 585 | - properties: | ||
| 586 | data: | ||
| 587 | $ref: '#/definitions/models.SearchResponse' | ||
| 588 | type: object | ||
| 451 | "400": | 589 | "400": |
| 452 | description: Bad Request | 590 | description: Bad Request |
| 453 | schema: | 591 | schema: |