Ozai/openapi.yaml

212 lines
4.9 KiB
YAML
Raw Normal View History

2024-01-28 00:57:40 +01:00
openapi: 3.0.0
2024-01-27 23:06:56 +01:00
info:
title: PVV Ozai
description: PVV Ozai
version: 1.0.0
servers:
- url: https://ozai.pvv.ntnu.no
paths:
2024-01-28 00:57:40 +01:00
/game:
post:
summary: Create a game
description: Creates a game
operationId: createGame
parameters:
- name: playerNames
in: query
description: Unique list of players to join the game. (Length of 2-4)
required: true
schema:
type: array
items:
type: string
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/GameResponse'
'400':
description: Invalid input
/game/{gameId}:
2024-01-27 23:06:56 +01:00
get:
summary: Find pet by ID
description: Returns a single pet
operationId: getGameById
parameters:
- name: gameId
in: path
description: ID of game
required: true
schema:
type: integer
format: int64
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/GameState'
application/xml:
schema:
$ref: '#/components/schemas/GameState'
'400':
description: Invalid ID supplied
'404':
description: Game not found
put:
summary: Submit move
description: ''
operationId: submitMove
parameters:
- name: gameId
in: path
description: ID of pet that needs to be updated
required: true
schema:
type: integer
format: int64
2024-01-28 00:57:40 +01:00
- name: playerName
in: header
description: name of player/bot
required: true
2024-01-27 23:06:56 +01:00
schema:
type: string
2024-01-28 00:57:40 +01:00
- name: move
2024-01-27 23:06:56 +01:00
in: query
2024-01-28 00:57:40 +01:00
description: Mov
2024-01-27 23:06:56 +01:00
schema:
2024-01-28 00:57:40 +01:00
$ref: '#/components/schemas/Move'
2024-01-27 23:06:56 +01:00
responses:
'400':
description: Invalid input
components:
schemas:
GameState:
type: object
properties:
2024-01-28 00:57:40 +01:00
playerNames:
type: array
items:
type: string
currentPlayerName:
type: string
currentPlayerId:
2024-01-27 23:06:56 +01:00
type: integer
format: int32
bag:
$ref: '#/components/schemas/TileSet'
lid:
$ref: '#/components/schemas/TileSet'
factories:
type: array
items:
$ref: '#/components/schemas/TileSet'
market:
$ref: '#/components/schemas/TileSetWithStart'
players:
type: array
items:
$ref: '#/components/schemas/Player'
TileSet:
type: object
properties:
blue:
type: integer
format: int32
yellow:
type: integer
format: int32
red:
type: integer
format: int32
black:
type: integer
format: int32
white:
type: integer
format: int32
TileSetWithStart:
type: object
properties:
start:
type: integer
format: int32
blue:
type: integer
format: int32
yellow:
type: integer
format: int32
red:
type: integer
format: int32
black:
type: integer
format: int32
white:
type: integer
format: int32
Player:
type: object
properties:
points:
type: integer
format: int32
patternLines:
type: array
items:
$ref: '#/components/schemas/PatternLine'
wall:
$ref: '#/components/schemas/Wall'
floor:
$ref: '#/components/schemas/TileSetWithStart'
PatternLine:
type: object
properties:
color:
$ref: '#/components/schemas/Color'
number:
type: integer
format: int32
Color:
enum: ["blue", "yellow", "red", "black", "white"]
Wall:
type: object
properties:
blue:
type: boolean
yellow:
type: boolean
red:
type: boolean
black:
type: boolean
white:
type: boolean
Move:
type: object
properties:
player:
2024-01-28 00:57:40 +01:00
description: internal playerid (is this player 1 or 2)
2024-01-27 23:06:56 +01:00
type: integer
format: int32
market:
type: boolean
factory:
type: integer
format: int32
color:
$ref: '#/components/schemas/Color'
patternLine:
type: integer
format: int32
2024-01-28 00:57:40 +01:00
GameResponse:
type: object
properties:
gameId:
type: integer