{"swagger":"2.0","info":{"description":"7Quizzes Game controller API","version":"1_singleplayer","title":"7Quizzes Game controller API","contact":{"email":"dev-teachers@7bits.it"},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}},"host":"virtserver.swaggerhub.com","basePath":"/dev-teachers/7Quizzes/1_singleplayer","tags":[{"name":"Game","description":"Game requests"}],"schemes":["https"],"paths":{"/rooms/{roomId}/game/start":{"post":{"tags":["Game"],"summary":"Start the game","description":"Start the game and get first question","operationId":"startGame","produces":["application/json"],"parameters":[{"name":"roomId","in":"path","description":"The room id","required":true,"type":"string","format":"uuid"}],"responses":{"200":{"description":"Successfully started","schema":{"$ref":"#/definitions/question"}},"400":{"description":"Invalid input, object invalid"},"404":{"description":"Room with requested id was not found"}}}},"/rooms/{roomId}/game/question/{questionId}":{"get":{"tags":["Game"],"summary":"Get question data","description":"Get the question text and possible answers","operationId":"getQuestion","produces":["application/json"],"parameters":[{"name":"roomId","in":"path","description":"The room id","required":true,"type":"string","format":"uuid"},{"name":"questionId","in":"path","description":"The question id","required":true,"type":"string","format":"uuid"}],"responses":{"200":{"description":"Successfully selected a question","schema":{"$ref":"#/definitions/questionWithOptions"}},"400":{"description":"Invalid input, object invalid"},"404":{"description":"Room or question with requested id was not found"}}}},"/rooms/{roomId}/game/question/{questionId}/answer":{"post":{"tags":["Game"],"summary":"Answer the question","description":"Answer the question by passing one of its options.\nIf game is over, nextQuestionId in the response is null.\n","operationId":"answerQuestion","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"roomId","in":"path","description":"The room id","required":true,"type":"string","format":"uuid"},{"name":"questionId","in":"path","description":"The question id","required":true,"type":"string","format":"uuid"},{"in":"body","name":"answerQuestionRequest","description":"Answer question request body","required":true,"schema":{"$ref":"#/definitions/answerQuestionRequest"}}],"responses":{"200":{"description":"Successfully answered","schema":{"$ref":"#/definitions/answerQuestionResponse"}},"400":{"description":"Invalid input, object invalid"},"404":{"description":"Room, answer, player or question with requested id was not found"},"409":{"description":"Incorrect answer posted, this question is out of order"}}}}},"definitions":{"question":{"properties":{"questionId":{"type":"string","format":"uuid"}}},"questionWithOptions":{"properties":{"questionId":{"type":"string","format":"uuid"},"questionText":{"type":"string","example":"some-question-text"},"answersList":{"type":"array","items":{"$ref":"#/definitions/questionAnswer"}}}},"answerQuestionRequest":{"type":"object","required":["answerId"],"properties":{"answerId":{"type":"string","format":"uuid"}}},"answerQuestionResponse":{"type":"object","properties":{"correctAnswerId":{"type":"string","format":"uuid"},"nextQuestionId":{"type":"string","format":"uuid","example":"156090cf-c6d5-4cab-9271-d948f5ae5537"},"totalScore":{"type":"integer","example":10},"questionScore":{"type":"integer","example":1}}},"questionAnswer":{"properties":{"answerId":{"type":"string","format":"uuid"},"answerText":{"type":"string","example":"some-answer-text"}}}}}