From 9005fe998491c4533e07c889cc72fbf6604987f8 Mon Sep 17 00:00:00 2001 From: Adrian Gunnar Lauterer Date: Sun, 28 Jan 2024 00:57:40 +0100 Subject: [PATCH] Update openapi.yaml --- openapi.yaml | 56 +++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 47 insertions(+), 9 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 0263e44..0f085cc 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.1.0 +openapi: 3.0.0 info: title: PVV Ozai description: PVV Ozai @@ -6,7 +6,32 @@ info: servers: - url: https://ozai.pvv.ntnu.no paths: - /{gameId}: + /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}: get: summary: Find pet by ID description: Returns a single pet @@ -45,16 +70,17 @@ paths: schema: type: integer format: int64 + - name: playerName + in: header + description: name of player/bot + required: true + schema: + type: string - 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 + $ref: '#/components/schemas/Move' responses: '400': description: Invalid input @@ -63,7 +89,13 @@ components: GameState: type: object properties: - currentPlayer: + playerNames: + type: array + items: + type: string + currentPlayerName: + type: string + currentPlayerId: type: integer format: int32 bag: @@ -160,6 +192,7 @@ components: type: object properties: player: + description: internal playerid (is this player 1 or 2) type: integer format: int32 market: @@ -172,3 +205,8 @@ components: patternLine: type: integer format: int32 + GameResponse: + type: object + properties: + gameId: + type: integer \ No newline at end of file -- 2.44.2