diff --git a/doc/specs/schemas/ArenaPlayerPerformance.yaml b/doc/specs/schemas/ArenaPlayerPerformance.yaml index f4d116fc..7b4ff9ab 100644 --- a/doc/specs/schemas/ArenaPlayerPerformance.yaml +++ b/doc/specs/schemas/ArenaPlayerPerformance.yaml @@ -13,13 +13,10 @@ properties: type: number score: type: number + flair: + $ref: './Flair.yaml' sheet: - type: object - properties: - scores: - type: string - fire: - type: boolean + $ref: './ArenaSheet.yaml' nb: type: object properties: diff --git a/doc/specs/schemas/ArenaSheet.yaml b/doc/specs/schemas/ArenaSheet.yaml new file mode 100644 index 00000000..99d9ebbe --- /dev/null +++ b/doc/specs/schemas/ArenaSheet.yaml @@ -0,0 +1,8 @@ +type: object +required: + - scores +properties: + scores: + type: string + fire: + type: boolean diff --git a/doc/specs/schemas/GamePgn.yaml b/doc/specs/schemas/GamePgn.yaml index e49bdfa4..8b60f247 100644 --- a/doc/specs/schemas/GamePgn.yaml +++ b/doc/specs/schemas/GamePgn.yaml @@ -1,3 +1,4 @@ +type: string example: | [Event "Rated Blitz game"] [Site "https://lichess.org/fY44h4OY"] diff --git a/doc/specs/tags/arenatournaments/api-tournament-id-results.yaml b/doc/specs/tags/arenatournaments/api-tournament-id-results.yaml index 5888dacc..8bda4734 100644 --- a/doc/specs/tags/arenatournaments/api-tournament-id-results.yaml +++ b/doc/specs/tags/arenatournaments/api-tournament-id-results.yaml @@ -8,7 +8,7 @@ get: due to ranking changes while the players are being streamed. Use on finished tournaments for guaranteed consistency. tags: - - "Arena tournaments" + - 'Arena tournaments' security: [] parameters: - in: path @@ -32,7 +32,7 @@ get: type: boolean default: false responses: - "200": + '200': description: The results of the Arena tournament. headers: Access-Control-Allow-Origin: @@ -42,12 +42,41 @@ get: content: application/x-ndjson: schema: - example: { - "rank": 4, - "score": 389, - "rating": 2618, - "username": "opperwezen", - "title": "IM", - "performance": 2423, - "team": "coders" - } + type: object + required: + - rank + - score + - rating + - username + - performance + - team + properties: + rank: + type: number + score: + type: number + rating: + type: number + username: + type: string + performance: + type: number + title: + $ref: '../../schemas/Title.yaml' + team: + type: string + flair: + $ref: '../../schemas/Flair.yaml' + sheet: + $ref: '../../schemas/ArenaSheet.yaml' + example: + { + 'rank': 4, + 'score': 389, + 'rating': 2618, + 'username': 'opperwezen', + 'title': 'IM', + 'performance': 2423, + 'team': 'coders', + 'sheet': { 'scores': '1022112122211221' }, + } diff --git a/doc/specs/tags/arenatournaments/api-tournament-id-teams.yaml b/doc/specs/tags/arenatournaments/api-tournament-id-teams.yaml index f0fac7b2..5809fd8a 100644 --- a/doc/specs/tags/arenatournaments/api-tournament-id-teams.yaml +++ b/doc/specs/tags/arenatournaments/api-tournament-id-teams.yaml @@ -4,7 +4,7 @@ get: description: | Teams of a team battle tournament, with top players, sorted by rank (best first). tags: - - "Arena tournaments" + - 'Arena tournaments' security: [] parameters: - in: path @@ -14,7 +14,7 @@ get: type: string required: true responses: - "200": + '200': description: The list of teams of a team battle tournament, with their respective top players. headers: Access-Control-Allow-Origin: @@ -24,17 +24,54 @@ get: content: application/json: schema: - example: { - "id": "CdPg1ey4", - "teams": [ - { - "rank": 1, - "id": "cat-lovers", - "score": 842, - "players": [ - { "user": { "name": "lizen69", "id": "lizen69" }, "score": 54 }, - { "user": { "name": "lizen249", "id": "lizen249" } } - ] - } - ] - } + type: object + required: + - id + - teams + properties: + id: + type: string + teams: + type: array + items: + type: object + required: + - rank + - id + - score + - players + properties: + rank: + type: number + id: + type: string + score: + type: number + players: + type: array + items: + type: object + required: + - user + properties: + user: + $ref: '../../schemas/LightUser.yaml' + score: + type: number + example: + { + 'id': 'CdPg1ey4', + 'teams': + [ + { + 'rank': 1, + 'id': 'cat-lovers', + 'score': 842, + 'players': + [ + { 'user': { 'name': 'lizen69', 'id': 'lizen69' }, 'score': 54 }, + { 'user': { 'name': 'lizen249', 'id': 'lizen249' } }, + ], + }, + ], + } diff --git a/doc/specs/tags/board/api-board-seek.yaml b/doc/specs/tags/board/api-board-seek.yaml index 35f2023d..5fd888c3 100644 --- a/doc/specs/tags/board/api-board-seek.yaml +++ b/doc/specs/tags/board/api-board-seek.yaml @@ -24,43 +24,56 @@ post: content: application/x-www-form-urlencoded: schema: - type: object - properties: - rated: - type: boolean - description: Whether the game is rated and impacts players ratings. - example: true - default: false - time: - type: number - description: Clock initial time in minutes. Required for real-time seeks. - example: 15 - minimum: 0 - maximum: 180 - increment: - type: integer - description: Clock increment in seconds. Required for real-time seeks. - example: 15 - minimum: 0 - maximum: 180 - days: - type: integer - description: Days per turn. Required for correspondence seeks. - enum: - - 1 - - 2 - - 3 - - 5 - - 7 - - 10 - - 14 - variant: - $ref: '../../schemas/VariantKey.yaml' - ratingRange: - type: string - description: | - The rating range of potential opponents. Better left empty. - Example: 1500-1800 + allOf: + - type: object + properties: + rated: + type: boolean + description: Whether the game is rated and impacts players ratings. + example: true + default: false + variant: + $ref: '../../schemas/VariantKey.yaml' + ratingRange: + type: string + description: | + The rating range of potential opponents. Better left empty. + Example: 1500-1800 + - oneOf: + - type: object + title: real-time + required: + - time + - increment + properties: + time: + type: number + description: Clock initial time in minutes. Required for real-time seeks. + example: 15 + minimum: 0 + maximum: 180 + increment: + type: integer + description: Clock increment in seconds. Required for real-time seeks. + example: 15 + minimum: 0 + maximum: 180 + - type: object + title: correspondence + required: + - days + properties: + days: + type: integer + description: Days per turn. Required for correspondence seeks. + enum: + - 1 + - 2 + - 3 + - 5 + - 7 + - 10 + - 14 responses: "200": description: The seek was successfully created. @@ -70,8 +83,22 @@ post: type: string default: "'*'" content: - text/plain: - example: "" + application/json: + schema: + type: object + description: Only happens when doing a correspondence seek + required: + - id + properties: + id: + type: string + example: { + id: 'gwkzmEBY' + } + application/x-ndjson: + schema: + description: Only happens when doing a real-time seek + example: '' "400": description: The creation of the seek failed. content: diff --git a/doc/specs/tags/challenges/api-token-admin-challenge.yaml b/doc/specs/tags/challenges/api-token-admin-challenge.yaml index a7e45715..060a3edc 100644 --- a/doc/specs/tags/challenges/api-token-admin-challenge.yaml +++ b/doc/specs/tags/challenges/api-token-admin-challenge.yaml @@ -8,7 +8,7 @@ post: tags: - Challenges security: - - OAuth2: ["web:mod"] + - OAuth2: ['web:mod'] requestBody: required: true content: @@ -23,12 +23,12 @@ post: description: description: User visible description of the token type: string - example: "FIDE tournament XYZ" + example: 'FIDE tournament XYZ' required: - users - description responses: - "200": + '200': description: The `challenge:write` tokens of each user headers: Access-Control-Allow-Origin: @@ -37,8 +37,18 @@ post: default: "'*'" content: application/json: - example: { "thibault": "lLOEkpH58W599xH9", "neio": "nAYTIJphwWFwKmKk", "lizen2": "1cnHhuWKHROgiPC4", "lizen3": "SszJ9Sj1bto0UQCK" } - "400": + schema: + type: object + additionalProperties: + type: string + example: + { + 'thibault': 'lLOEkpH58W599xH9', + 'neio': 'nAYTIJphwWFwKmKk', + 'lizen2': '1cnHhuWKHROgiPC4', + 'lizen3': 'SszJ9Sj1bto0UQCK', + } + '400': description: The creation of the tokens failed. content: application/json: diff --git a/doc/specs/tags/swisstournaments/api-swiss-id-results.yaml b/doc/specs/tags/swisstournaments/api-swiss-id-results.yaml index f7ad3de4..dece8fa9 100644 --- a/doc/specs/tags/swisstournaments/api-swiss-id-results.yaml +++ b/doc/specs/tags/swisstournaments/api-swiss-id-results.yaml @@ -8,7 +8,7 @@ get: due to ranking changes while the players are being streamed. Use on finished tournaments for guaranteed consistency. tags: - - "Swiss tournaments" + - 'Swiss tournaments' security: [] parameters: - in: path @@ -24,7 +24,7 @@ get: type: integer minimum: 1 responses: - "200": + '200': description: The results of a Swiss tournament. headers: Access-Control-Allow-Origin: @@ -34,12 +34,38 @@ get: content: application/x-ndjson: schema: - example: { - "rank": 4, - "points": 8.5, - "tieBreak": 77, - "rating": 2618, - "username": "opperwezen", - "title": "IM", - "performance": 2423 - } + type: object + required: + - rank + - points + - tieBreak + - rating + - username + - performance + properties: + absent: + type: boolean + rank: + type: number + points: + type: number + tieBreak: + type: number + rating: + type: number + username: + type: string + title: + $ref: '../../schemas/Title.yaml' + performance: + type: number + example: + { + 'rank': 4, + 'points': 8.5, + 'tieBreak': 77, + 'rating': 2618, + 'username': 'opperwezen', + 'title': 'IM', + 'performance': 2423, + }