Skip to content

Commit

Permalink
Merge pull request #394 from fitztrev/study-schemas
Browse files Browse the repository at this point in the history
Update study schemas
  • Loading branch information
fitztrev authored Nov 8, 2024
2 parents b96976e + 4193c18 commit f03446a
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 7 deletions.
54 changes: 53 additions & 1 deletion doc/specs/schemas/StudyImportPgnChapters.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,53 @@
example: { 'chapters': [{ 'id': 'WTvnkWAL', 'name': 'Game 2' }] }
type: object

properties:
chapters:
type: array
items:
type: object
properties:
id:
type: string
description: The chapter ID
name:
type: string
description: The chapter name
players:
type: array
minItems: 2
maxItems: 2
items:
type: object
properties:
name:
type:
- string
- "null"
description: The player name
rating:
type: integer
description: The player rating
status:
type: string
description: The chapter status

example:
{
"chapters": [
{
"id": "iBjmYBya",
"name": "test 2",
"players": [
{
"name": "Carlsen, Magnus",
"rating": 2837
},
{
"name": "Chadaev, Nikolay",
"rating": 2580
}
],
"status": "1-0"
}
]
}
25 changes: 24 additions & 1 deletion doc/specs/schemas/StudyMetadata.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,25 @@
type: object

properties:
id:
type: string
description: The study ID
name:
type: string
description: The study name
createdAt:
type: integer
format: int64
description: The study creation date
updatedAt:
type: integer
format: int64
description: The study last update date

example:
{ 'id': 'WTvnkWAL', 'name': 'Guess the move', 'createdAt': 1463756350225, 'updatedAt': 1469965025205 }
{
"id": "WTvnkWAL",
"name": "Guess the move",
"createdAt": 1463756350225,
"updatedAt": 1469965025205
}
2 changes: 1 addition & 1 deletion doc/specs/tags/broadcasts/api-broadcasts-top.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ get:
type: string
default: "'*'"
content:
application/x-ndjson:
application/json:
schema:
$ref: "../../schemas/BroadcastTop.yaml"
11 changes: 10 additions & 1 deletion doc/specs/tags/games/api-import.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,14 @@ post:
content:
application/json:
schema:
type: object
properties:
id:
type: string
description: The game ID
example: "R6iLjwz5"
url:
type: string
format: uri
description: The game URL
example: {"id": "R6iLjwz5", "url": "https://lichess.org/R6iLjwz5"}

4 changes: 1 addition & 3 deletions doc/specs/tags/studies/api-study-by-username.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,4 @@ get:
content:
application/x-ndjson:
schema:
type: array
items:
$ref: '../../schemas/StudyMetadata.yaml'
$ref: '../../schemas/StudyMetadata.yaml'

0 comments on commit f03446a

Please sign in to comment.