aboutsummaryrefslogtreecommitdiffhomepage
path: root/openapi.yaml
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-07-28 17:13:01 +0900
committernsfisis <nsfisis@gmail.com>2024-07-28 17:13:01 +0900
commitaadc8cf037855b99cb82798c7b0ebaafc5bb025b (patch)
tree4ea9f9db9dbe7cf1b7720205ae281a6b8bcca8e9 /openapi.yaml
parent90741e8336b4ffba090bf08c3b899992860e2d98 (diff)
parent2d5f913a431c4223a16c88551ffff4100ac483c4 (diff)
downloadphperkaigi-2025-albatross-aadc8cf037855b99cb82798c7b0ebaafc5bb025b.tar.gz
phperkaigi-2025-albatross-aadc8cf037855b99cb82798c7b0ebaafc5bb025b.tar.zst
phperkaigi-2025-albatross-aadc8cf037855b99cb82798c7b0ebaafc5bb025b.zip
Merge branch 'game-entry'
Diffstat (limited to 'openapi.yaml')
-rw-r--r--openapi.yaml94
1 files changed, 91 insertions, 3 deletions
diff --git a/openapi.yaml b/openapi.yaml
index a0348d9..002b229 100644
--- a/openapi.yaml
+++ b/openapi.yaml
@@ -3,7 +3,7 @@ info:
title: Albatross internal web API
version: 0.1.0
paths:
- /api/login:
+ /login:
post:
summary: User login
requestBody:
@@ -47,13 +47,53 @@ 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:
type: object
properties:
user_id:
- type: number
+ type: integer
example: 123
username:
type: string
@@ -63,7 +103,6 @@ components:
example: "John Doe"
icon_path:
type: string
- nullable: true
example: "/images/john.jpg"
is_admin:
type: boolean
@@ -73,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