{"openapi":"3.0.0","info":{"version":"0.98.6","title":"98point6 Drop Token","description":"A REST-like API for the drop token game, similar to Hasbro's Connect Four"},"servers":[{"description":"SwaggerHub API Auto Mocking","url":"https://virtserver.swaggerhub.com/thebenedict/98point6DT/0.98.6"}],"paths":{"/drop_token":{"get":{"summary":"Return all in-progress games","responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"games":{"type":"array","items":{"type":"string","format":"uuid"}}}}}}}}},"post":{"summary":"Create a new game","responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"gameId":{"type":"string","format":"uuid"}}}}}},"400":{"description":"malformed request"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"players":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":2,"maxItems":2,"uniqueItems":true},"columns":{"type":"integer","format":"int32","default":4},"rows":{"type":"integer","format":"int32","default":4}}}}}}}},"/drop_token/{gameId}":{"get":{"summary":"Get the state of the game","parameters":[{"name":"gameId","in":"path","description":"ID of game to be retreived","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"players":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":2,"maxItems":2,"uniqueItems":true},"state":{"type":"string","enum":["DONE","IN_PROGRESS"]},"winner":{"type":"string","format":"uuid","nullable":true}}}}}},"400":{"description":"malformed request"},"404":{"description":"game/moves not found"}}}},"/drop_token/{gameId}/moves":{"get":{"summary":"Get a (sub)list of the moves played","parameters":[{"name":"gameId","in":"path","description":"ID of game to retreive moves from","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"start","in":"query","schema":{"type":"integer"},"description":"Start of range of moves retrieved, inclusive"},{"name":"until","in":"query","schema":{"type":"integer"},"description":"End of range of moves retrieved, inclusive"}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["MOVE","QUIT"]},"player":{"type":"string","format":"uuid"},"column":{"type":"integer","format":"int32"}}}}}}},"400":{"description":"malformed request"},"404":{"description":"game/moves not found"}}}},"/drop_token/{gameId}/{playerId}":{"delete":{"summary":"Player quits from the game","parameters":[{"name":"gameId","in":"path","description":"ID of current game","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"playerId","in":"path","description":"ID of player making the move","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"successful operation"},"404":{"description":"game not found, or player not found in game"},"410":{"description":"not found"}}},"post":{"summary":"Post a move","parameters":[{"name":"gameId","in":"path","description":"ID of current game","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"playerId","in":"path","description":"ID of player making the move","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"move":{"type":"string","format":"uri"}}}}}},"400":{"description":"malformed input/illegal move"},"404":{"description":"not found"},"409":{"description":"play attempted out of turn"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"column":{"type":"integer","format":"int32"}}}}}}}},"/drop_token/{gameId}/moves/{move_number}":{"get":{"summary":"Return a move","parameters":[{"name":"gameId","in":"path","description":"ID of game to retreive move from","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"move_number","in":"path","description":"Move number to retreive","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["MOVE"]},"player":{"type":"string","format":"uuid"},"column":{"type":"integer","format":"int32"}}}}}},"400":{"description":"malformed request"},"404":{"description":"game or move not found"}}}}}}