Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More schemas #412

Merged
merged 1 commit into from
Jan 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions doc/specs/schemas/ArenaPlayerPerformance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 8 additions & 0 deletions doc/specs/schemas/ArenaSheet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
type: object
required:
- scores
properties:
scores:
type: string
fire:
type: boolean
1 change: 1 addition & 0 deletions doc/specs/schemas/GamePgn.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
type: string
example: |
[Event "Rated Blitz game"]
[Site "https://lichess.org/fY44h4OY"]
Expand Down
51 changes: 40 additions & 11 deletions doc/specs/tags/arenatournaments/api-tournament-id-results.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -32,7 +32,7 @@ get:
type: boolean
default: false
responses:
"200":
'200':
description: The results of the Arena tournament.
headers:
Access-Control-Allow-Origin:
Expand All @@ -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' },
}
69 changes: 53 additions & 16 deletions doc/specs/tags/arenatournaments/api-tournament-id-teams.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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' } },
],
},
],
}
105 changes: 66 additions & 39 deletions doc/specs/tags/board/api-board-seek.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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:
Expand Down
20 changes: 15 additions & 5 deletions doc/specs/tags/challenges/api-token-admin-challenge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ post:
tags:
- Challenges
security:
- OAuth2: ["web:mod"]
- OAuth2: ['web:mod']
requestBody:
required: true
content:
Expand All @@ -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:
Expand All @@ -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:
Expand Down
Loading
Loading