{"swagger":"2.0","info":{"description":"7Quizzes Game controller API","version":"1.0.1","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"}},"tags":[{"name":"Game","description":"Game requests"}],"paths":{"/rooms/{roomId}/game/start":{"parameters":[{"in":"path","name":"roomId","required":true,"type":"string","description":"The room id"}],"post":{"tags":["Game"],"summary":"Start the game","operationId":"startGame","description":"Allows to start the game and get first question","produces":["application/json"],"responses":{"200":{"description":"Successfully started","schema":{"$ref":"#/definitions/questionLocation"}},"400":{"description":"Invalid input, object invalid"},"404":{"description":"Room with requested id was not found"}}}},"/rooms/{roomId}/game/question/{questionId}":{"parameters":[{"in":"path","name":"roomId","required":true,"type":"string","description":"The room id"},{"in":"path","name":"questionId","required":true,"type":"string","description":"The question id"}],"get":{"tags":["Game"],"summary":"Get question data","operationId":"getQuestion","description":"Allows to get the question text and possible answers","produces":["application/json"],"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":{"parameters":[{"in":"path","name":"roomId","required":true,"type":"string","description":"The room id"},{"in":"path","name":"questionId","required":true,"type":"string","description":"The question id"}],"post":{"tags":["Game"],"summary":"Answer the question","operationId":"answerQuestion","description":"Allows to answer the question by passing one of its options.\nIf game is over, nextQuestionId in the response is null.\n","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"answerQuestionRequest","description":"Answer question request body","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":{"questionLocation":{"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"}}}},"schemes":["https"],"host":"virtserver.swaggerhub.com","basePath":"/dev-teachers/7Quizzes/1.0.1"}