openapi: 3.0.1 info: title: shipit-clicker description: ShipIt Clicker version: 2.0.0 servers: - url: /api/v2 tags: - name: Game description: Shipit Clicker game API - name: Specification description: The swagger API specification paths: /games/: post: tags: - Game description: Create new game requestBody: description: Empty object request body content: application/json: schema: $ref: '#/components/schemas/Empty' required: false responses: 201: description: Return the newly created game start timestamp with the specified id content: application/json: schema: $ref: '#/components/schemas/Game' 5XX: description: Server error content: application/json: schema: $ref: '#/components/schemas/Error' /games/{id}: get: tags: - Game parameters: - name: id in: path description: The id of the game to retrieve required: true schema: type: string responses: 200: description: Return the game containing the game start timestamp with the specified id content: application/json: schema: $ref: '#/components/schemas/Game' 4XX: description: Game not found content: application/json: schema: $ref: '#/components/schemas/Error' 5XX: description: Server Error content: application/json: schema: $ref: '#/components/schemas/Error' /games/{id}/{element}: get: tags: - Game parameters: - name: id in: path description: The id of the game item to retrieve required: true schema: type: string - name: element in: path description: The element of the game item to retrieve required: true schema: type: string responses: 200: description: Return the game item with the specified id content: application/json: schema: $ref: '#/components/schemas/Game' 4XX: description: Game not found content: application/json: schema: $ref: '#/components/schemas/Error' 5XX: description: Server Error content: application/json: schema: $ref: '#/components/schemas/Error' put: tags: - Game description: Create or update a new game item requestBody: description: The game item to create or update content: application/json: schema: $ref: '#/components/schemas/GameItem' required: true responses: 201: description: Return the newly created game item with the specified id content: application/json: schema: $ref: '#/components/schemas/GameItem' 5XX: description: Server error content: application/json: schema: $ref: '#/components/schemas/Error' patch: tags: - Game description: Increment a game item by a certain amount requestBody: description: The amonunt of the game item to increment content: application/json: schema: $ref: '#/components/schemas/GameItem' required: true responses: 200: description: The increment has been accepted content: application/json: schema: $ref: '#/components/schemas/GameItem' 5XX: description: Server error content: application/json: schema: $ref: '#/components/schemas/Error' /spec: get: tags: - Specification responses: 200: description: Return the API specification content: {} components: schemas: Error: type: object additionalProperties: true Empty: type: object additionalProperties: false Game: type: object properties: id: type: string example: sample-game started_on: type: integer example: 1586458255 GameItem: title: Game Item required: - id - element - value type: object properties: id: type: string example: sample-game element: type: string example: score value: type: integer example: 3