aboutsummaryrefslogtreecommitdiffhomepage
path: root/openapi.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'openapi.yaml')
-rw-r--r--openapi.yaml89
1 files changed, 89 insertions, 0 deletions
diff --git a/openapi.yaml b/openapi.yaml
index 786e11e..002b229 100644
--- a/openapi.yaml
+++ b/openapi.yaml
@@ -47,6 +47,46 @@ paths:
example: "Invalid credentials"
required:
- message
+ /games:
+ get:
+ summary: List games
+ parameters:
+ - in: query
+ name: player_id
+ schema:
+ type: integer
+ required: false
+ - in: header
+ name: Authorization
+ schema:
+ type: string
+ required: true
+ responses:
+ '200':
+ description: List of games
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ games:
+ type: array
+ items:
+ $ref: '#/components/schemas/Game'
+ required:
+ - games
+ '403':
+ description: Forbidden
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ message:
+ type: string
+ example: "Forbidden operation"
+ required:
+ - message
components:
schemas:
JwtPayload:
@@ -72,3 +112,52 @@ components:
- username
- display_name
- is_admin
+ Game:
+ type: object
+ properties:
+ game_id:
+ type: integer
+ example: 1
+ state:
+ type: string
+ example: "active"
+ enum:
+ - closed
+ - waiting_entries
+ - waiting_start
+ - prepare
+ - starting
+ - gaming
+ - finished
+ display_name:
+ type: string
+ example: "Game 1"
+ duration_seconds:
+ type: integer
+ example: 360
+ started_at:
+ type: integer
+ example: 946684800
+ problem:
+ $ref: '#/components/schemas/Problem'
+ required:
+ - game_id
+ - state
+ - display_name
+ - duration_seconds
+ Problem:
+ type: object
+ properties:
+ problem_id:
+ type: integer
+ example: 1
+ title:
+ type: string
+ example: "Problem 1"
+ description:
+ type: string
+ example: "This is a problem"
+ required:
+ - problem_id
+ - title
+ - description