From 6676e1cdffcbc9747e53d2cd21e812a07f77fa6c Mon Sep 17 00:00:00 2001 From: Eirik Witterso Date: Sat, 27 Jan 2024 23:06:56 +0100 Subject: [PATCH] Add initial API documentation --- openapi.yaml | 174 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 openapi.yaml diff --git a/openapi.yaml b/openapi.yaml new file mode 100644 index 0000000..0263e44 --- /dev/null +++ b/openapi.yaml @@ -0,0 +1,174 @@ +openapi: 3.1.0 +info: + title: PVV Ozai + description: PVV Ozai + version: 1.0.0 +servers: + - url: https://ozai.pvv.ntnu.no +paths: + /{gameId}: + 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 + - name: move + in: query + description: Mov + schema: + type: string + - name: status + in: query + description: Status of pet that needs to be updated + schema: + type: string + responses: + '400': + description: Invalid input +components: + schemas: + GameState: + type: object + properties: + currentPlayer: + 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: + type: integer + format: int32 + market: + type: boolean + factory: + type: integer + format: int32 + color: + $ref: '#/components/schemas/Color' + patternLine: + type: integer + format: int32