From 7f8277d89c8d60a91fded6d4095de9e789c61838 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Mon, 24 Apr 2023 18:05:38 +0300 Subject: doc: map summary and leaderboard endpoints (#38) --- docs/swagger.yaml | 112 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 102 insertions(+), 10 deletions(-) (limited to 'docs/swagger.yaml') diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 16e5eab..873dbee 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -7,17 +7,47 @@ definitions: type: object models.Map: properties: + chapter_name: + type: string + data: {} + game_name: + type: string id: type: integer - is_coop: - type: boolean - name: + map_name: type: string - records: {} - wr_score: + type: object + models.MapCategoryScores: + properties: + any: + type: integer + cm: type: integer - wr_time: + inbounds_sla: type: integer + no_sla: + type: integer + type: object + models.MapRecords: + properties: + records: {} + type: object + models.MapSummary: + properties: + category_scores: + $ref: '#/definitions/models.MapCategoryScores' + description: + type: string + first_completion: + type: string + rating: + type: number + routers: + items: + type: string + type: array + showcase: + type: string type: object models.ProfileResponse: properties: @@ -101,6 +131,29 @@ info: version: "1.0" paths: /demo: + get: + consumes: + - application/json + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/models.Response' + - properties: + data: + $ref: '#/definitions/models.RankingsResponse' + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/models.Response' + summary: Get rankings of every player. + tags: + - rankings + /demos: get: consumes: - application/json @@ -147,7 +200,7 @@ paths: summary: Get (redirect) login page for Steam auth. tags: - login - /maps/{id}: + /maps/{id}/leaderboards: get: consumes: - application/json @@ -167,13 +220,18 @@ paths: - $ref: '#/definitions/models.Response' - properties: data: - $ref: '#/definitions/models.Map' + allOf: + - $ref: '#/definitions/models.Map' + - properties: + data: + $ref: '#/definitions/models.MapRecords' + type: object type: object "400": description: Bad Request schema: $ref: '#/definitions/models.Response' - summary: Get map page with specified id. + summary: Get map leaderboards with specified id. tags: - maps /maps/{id}/record: @@ -236,6 +294,40 @@ paths: summary: Post record with demo of a specific map. tags: - maps + /maps/{id}/summary: + get: + consumes: + - application/json + parameters: + - description: Map ID + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/models.Response' + - properties: + data: + allOf: + - $ref: '#/definitions/models.Map' + - properties: + data: + $ref: '#/definitions/models.MapSummary' + type: object + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/models.Response' + summary: Get map summary with specified id. + tags: + - maps /profile: get: consumes: @@ -338,7 +430,7 @@ paths: summary: Update country code of session user. tags: - users - /user/{id}: + /users/{id}: get: consumes: - application/json -- cgit v1.2.3