diff options
Diffstat (limited to 'docs/swagger.yaml')
| -rw-r--r-- | docs/swagger.yaml | 138 |
1 files changed, 133 insertions, 5 deletions
diff --git a/docs/swagger.yaml b/docs/swagger.yaml index f719008..8b66ec8 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml | |||
| @@ -1,5 +1,21 @@ | |||
| 1 | basePath: /v1 | 1 | basePath: /v1 |
| 2 | definitions: | 2 | definitions: |
| 3 | models.Chapter: | ||
| 4 | properties: | ||
| 5 | game_id: | ||
| 6 | type: integer | ||
| 7 | id: | ||
| 8 | type: integer | ||
| 9 | name: | ||
| 10 | type: string | ||
| 11 | type: object | ||
| 12 | models.Game: | ||
| 13 | properties: | ||
| 14 | id: | ||
| 15 | type: integer | ||
| 16 | name: | ||
| 17 | type: string | ||
| 18 | type: object | ||
| 3 | models.LoginResponse: | 19 | models.LoginResponse: |
| 4 | properties: | 20 | properties: |
| 5 | token: | 21 | token: |
| @@ -41,6 +57,15 @@ definitions: | |||
| 41 | properties: | 57 | properties: |
| 42 | records: {} | 58 | records: {} |
| 43 | type: object | 59 | type: object |
| 60 | models.MapShort: | ||
| 61 | properties: | ||
| 62 | chapter_id: | ||
| 63 | type: integer | ||
| 64 | id: | ||
| 65 | type: integer | ||
| 66 | name: | ||
| 67 | type: string | ||
| 68 | type: object | ||
| 44 | models.MapSummary: | 69 | models.MapSummary: |
| 45 | properties: | 70 | properties: |
| 46 | category_scores: | 71 | category_scores: |
| @@ -122,6 +147,27 @@ definitions: | |||
| 122 | type: integer | 147 | type: integer |
| 123 | records: {} | 148 | records: {} |
| 124 | type: object | 149 | type: object |
| 150 | models.SearchResponse: | ||
| 151 | properties: | ||
| 152 | maps: | ||
| 153 | items: | ||
| 154 | properties: | ||
| 155 | id: | ||
| 156 | type: integer | ||
| 157 | name: | ||
| 158 | type: string | ||
| 159 | type: object | ||
| 160 | type: array | ||
| 161 | players: | ||
| 162 | items: | ||
| 163 | properties: | ||
| 164 | steam_id: | ||
| 165 | type: string | ||
| 166 | user_name: | ||
| 167 | type: string | ||
| 168 | type: object | ||
| 169 | type: array | ||
| 170 | type: object | ||
| 125 | models.UserRanking: | 171 | models.UserRanking: |
| 126 | properties: | 172 | properties: |
| 127 | total_score: | 173 | total_score: |
| @@ -141,6 +187,35 @@ info: | |||
| 141 | title: Least Portals Database API | 187 | title: Least Portals Database API |
| 142 | version: "1.0" | 188 | version: "1.0" |
| 143 | paths: | 189 | paths: |
| 190 | /chapters/{id}: | ||
| 191 | get: | ||
| 192 | parameters: | ||
| 193 | - description: Game ID | ||
| 194 | in: path | ||
| 195 | name: id | ||
| 196 | required: true | ||
| 197 | type: integer | ||
| 198 | produces: | ||
| 199 | - application/json | ||
| 200 | responses: | ||
| 201 | "200": | ||
| 202 | description: OK | ||
| 203 | schema: | ||
| 204 | allOf: | ||
| 205 | - $ref: '#/definitions/models.Response' | ||
| 206 | - properties: | ||
| 207 | data: | ||
| 208 | items: | ||
| 209 | $ref: '#/definitions/models.Chapter' | ||
| 210 | type: array | ||
| 211 | type: object | ||
| 212 | "400": | ||
| 213 | description: Bad Request | ||
| 214 | schema: | ||
| 215 | $ref: '#/definitions/models.Response' | ||
| 216 | summary: Get chapters from the specified game id. | ||
| 217 | tags: | ||
| 218 | - chapters | ||
| 144 | /demo: | 219 | /demo: |
| 145 | get: | 220 | get: |
| 146 | produces: | 221 | produces: |
| @@ -186,6 +261,29 @@ paths: | |||
| 186 | summary: Get demo with specified demo uuid. | 261 | summary: Get demo with specified demo uuid. |
| 187 | tags: | 262 | tags: |
| 188 | - demo | 263 | - demo |
| 264 | /games: | ||
| 265 | get: | ||
| 266 | produces: | ||
| 267 | - application/json | ||
| 268 | responses: | ||
| 269 | "200": | ||
| 270 | description: OK | ||
| 271 | schema: | ||
| 272 | allOf: | ||
| 273 | - $ref: '#/definitions/models.Response' | ||
| 274 | - properties: | ||
| 275 | data: | ||
| 276 | items: | ||
| 277 | $ref: '#/definitions/models.Game' | ||
| 278 | type: array | ||
| 279 | type: object | ||
| 280 | "400": | ||
| 281 | description: Bad Request | ||
| 282 | schema: | ||
| 283 | $ref: '#/definitions/models.Response' | ||
| 284 | summary: Get games from the leaderboards. | ||
| 285 | tags: | ||
| 286 | - games | ||
| 189 | /login: | 287 | /login: |
| 190 | get: | 288 | get: |
| 191 | consumes: | 289 | consumes: |
| @@ -209,10 +307,37 @@ paths: | |||
| 209 | summary: Get (redirect) login page for Steam auth. | 307 | summary: Get (redirect) login page for Steam auth. |
| 210 | tags: | 308 | tags: |
| 211 | - login | 309 | - login |
| 212 | /maps/{id}/leaderboards: | 310 | /maps/{id}: |
| 213 | get: | 311 | get: |
| 214 | consumes: | 312 | parameters: |
| 313 | - description: Chapter ID | ||
| 314 | in: path | ||
| 315 | name: id | ||
| 316 | required: true | ||
| 317 | type: integer | ||
| 318 | produces: | ||
| 215 | - application/json | 319 | - application/json |
| 320 | responses: | ||
| 321 | "200": | ||
| 322 | description: OK | ||
| 323 | schema: | ||
| 324 | allOf: | ||
| 325 | - $ref: '#/definitions/models.Response' | ||
| 326 | - properties: | ||
| 327 | data: | ||
| 328 | items: | ||
| 329 | $ref: '#/definitions/models.MapShort' | ||
| 330 | type: array | ||
| 331 | type: object | ||
| 332 | "400": | ||
| 333 | description: Bad Request | ||
| 334 | schema: | ||
| 335 | $ref: '#/definitions/models.Response' | ||
| 336 | summary: Get maps from the specified chapter id. | ||
| 337 | tags: | ||
| 338 | - maps | ||
| 339 | /maps/{id}/leaderboards: | ||
| 340 | get: | ||
| 216 | parameters: | 341 | parameters: |
| 217 | - description: Map ID | 342 | - description: Map ID |
| 218 | in: path | 343 | in: path |
| @@ -305,8 +430,6 @@ paths: | |||
| 305 | - maps | 430 | - maps |
| 306 | /maps/{id}/summary: | 431 | /maps/{id}/summary: |
| 307 | get: | 432 | get: |
| 308 | consumes: | ||
| 309 | - application/json | ||
| 310 | parameters: | 433 | parameters: |
| 311 | - description: Map ID | 434 | - description: Map ID |
| 312 | in: path | 435 | in: path |
| @@ -447,7 +570,12 @@ paths: | |||
| 447 | "200": | 570 | "200": |
| 448 | description: OK | 571 | description: OK |
| 449 | schema: | 572 | schema: |
| 450 | $ref: '#/definitions/models.Response' | 573 | allOf: |
| 574 | - $ref: '#/definitions/models.Response' | ||
| 575 | - properties: | ||
| 576 | data: | ||
| 577 | $ref: '#/definitions/models.SearchResponse' | ||
| 578 | type: object | ||
| 451 | "400": | 579 | "400": |
| 452 | description: Bad Request | 580 | description: Bad Request |
| 453 | schema: | 581 | schema: |