diff --git a/doc/specs/lichess-api.yaml b/doc/specs/lichess-api.yaml index 94890036..5b983d93 100644 --- a/doc/specs/lichess-api.yaml +++ b/doc/specs/lichess-api.yaml @@ -500,6 +500,9 @@ paths: /broadcast/{broadcastTournamentId}/players/{playerId}: $ref: "./tags/broadcasts/broadcast-broadcastTournamentId-players-playerId.yaml" + /broadcast/{broadcastTournamentId}/teams/standings: + $ref: "./tags/broadcasts/broadcast-broadcastTournamentId-teams-standings.yaml" + /broadcast/{broadcastTournamentId}/edit: $ref: "./tags/broadcasts/broadcast-broadcastTournamentId-edit.yaml" diff --git a/doc/specs/schemas/BroadcastGameEntry.yaml b/doc/specs/schemas/BroadcastGameEntry.yaml index e569ae82..10987ad8 100644 --- a/doc/specs/schemas/BroadcastGameEntry.yaml +++ b/doc/specs/schemas/BroadcastGameEntry.yaml @@ -12,11 +12,7 @@ properties: color: $ref: "./GameColor.yaml" points: - type: string - enum: - - "1" - - "1/2" - - "0" + $ref: "./BroadcastPointStr.yaml" customPoints: $ref: "./BroadcastCustomPoints.yaml" ratingDiff: diff --git a/doc/specs/schemas/BroadcastPointStr.yaml b/doc/specs/schemas/BroadcastPointStr.yaml new file mode 100644 index 00000000..9b87cb59 --- /dev/null +++ b/doc/specs/schemas/BroadcastPointStr.yaml @@ -0,0 +1,5 @@ +type: string +enum: + - "1" + - "1/2" + - "0" diff --git a/doc/specs/schemas/BroadcastTeamLeaderboardEntry.yaml b/doc/specs/schemas/BroadcastTeamLeaderboardEntry.yaml new file mode 100644 index 00000000..225321e2 --- /dev/null +++ b/doc/specs/schemas/BroadcastTeamLeaderboardEntry.yaml @@ -0,0 +1,28 @@ +properties: + name: + type: string + description: "The name of the team" + mp: + type: number + description: "Total match points scored" + gp: + type: number + description: "Total game points scored" + averageRating: + type: integer + description: "The average rating of the team's players" + matches: + type: array + items: + $ref: "./BroadcastTeamPOVMatchEntry.yaml" + players: + type: array + description: "Players who have played for the team and their overall score" + items: + $ref: "./BroadcastPlayerEntry.yaml" +required: + - name + - mp + - gp + - matches + - players diff --git a/doc/specs/schemas/BroadcastTeamPOVMatchEntry.yaml b/doc/specs/schemas/BroadcastTeamPOVMatchEntry.yaml new file mode 100644 index 00000000..30ababaa --- /dev/null +++ b/doc/specs/schemas/BroadcastTeamPOVMatchEntry.yaml @@ -0,0 +1,18 @@ +type: object +properties: + roundId: + type: string + opponent: + type: string + description: "The name of the opposing team" + mp: + type: number + description: "Match points scored in this match" + gp: + type: number + description: "Game points scored in this match" + points: + $ref: "./BroadcastPointStr.yaml" +required: + - roundId + - opponent diff --git a/doc/specs/schemas/BroadcastTour.yaml b/doc/specs/schemas/BroadcastTour.yaml index c3e28eba..e602a1a7 100644 --- a/doc/specs/schemas/BroadcastTour.yaml +++ b/doc/specs/schemas/BroadcastTour.yaml @@ -61,8 +61,6 @@ properties: description: type: string description: "Full tournament description in markdown format, or in HTML if the html=1 query parameter is set." - leaderboard: - type: boolean teamTable: type: boolean url: diff --git a/doc/specs/tags/broadcasts/broadcast-broadcastTournamentId-teams-standings.yaml b/doc/specs/tags/broadcasts/broadcast-broadcastTournamentId-teams-standings.yaml new file mode 100644 index 00000000..74f60118 --- /dev/null +++ b/doc/specs/tags/broadcasts/broadcast-broadcastTournamentId-teams-standings.yaml @@ -0,0 +1,28 @@ +get: + operationId: broadcastTeamLeaderboardGet + summary: Get the team leaderboard of a broadcast + description: | + Get the team leaderboard of a broadcast tournament, if available. + tags: + - Broadcasts + security: [] + parameters: + - in: path + name: broadcastTournamentId + description: The broadcast tournament ID + required: true + schema: + type: string + minLength: 8 + maxLength: 8 + responses: + "200": + description: The team leaderboard + content: + application/json: + schema: + type: array + items: + $ref: "../../schemas/BroadcastTeamLeaderboardEntry.yaml" + "404": + description: Broadcast tournament not found