Last active
August 29, 2015 14:04
-
-
Save PavelPolyakov/f855b01356b3ca2497f1 to your computer and use it in GitHub Desktop.
quests.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"basePath": "http://local.questouri.com/api", | |
"swaggerVersion": "1.2", | |
"apiVersion": "0.1", | |
"resourcePath": "/quests", | |
"apis": [ | |
{ | |
"path": "/quests", | |
"description": "Display a listing of the resource. GET /user-quests", | |
"operations": [ | |
{ | |
"method": "GET", | |
"summary": "List all the user quests", | |
"nickname": "get.quests", | |
"type": "array", | |
"items": { | |
"$ref": "Quest+UserQuest" | |
}, | |
"responseMessages": [ | |
{ | |
"code": 200, | |
"message": "Everything is ok" | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"path": "/quests/start", | |
"description": "Start the quest for the logged in user", | |
"operations": [ | |
{ | |
"method": "POST", | |
"summary": "Answering the mechanic", | |
"nickname": "post.quests/start", | |
"parameters": [ | |
{ | |
"paramType": "form", | |
"name": "user_mission_id", | |
"type": "integer", | |
"required": true, | |
"description": "user mission id" | |
}, | |
{ | |
"paramType": "form", | |
"name": "mechanic_id", | |
"type": "integer", | |
"required": true, | |
"description": "mechanic id" | |
}, | |
{ | |
"paramType": "form", | |
"name": "answer", | |
"type": "string", | |
"required": false, | |
"description": "answer (array)" | |
} | |
], | |
"responseMessages": [ | |
{ | |
"code": 200, | |
"message": "Everything is ok" | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"path": "/quests/{id}", | |
"description": "Display certain quest with missions. GET /quests/{id}", | |
"operations": [ | |
{ | |
"method": "GET", | |
"summary": "Display certain quest with missions, mechanics and user information", | |
"nickname": "get.quests/{id}", | |
"type": "Quest+UserQuest+Missions+UserMission+Mechanics+UserMechanic", | |
"parameters": [ | |
{ | |
"paramType": "path", | |
"name": "id", | |
"type": "integer", | |
"required": true, | |
"description": "quest id" | |
} | |
], | |
"responseMessages": [ | |
{ | |
"code": 200, | |
"message": "Everything is ok" | |
} | |
] | |
} | |
] | |
} | |
], | |
"models": { | |
"Quest+UserQuest": { | |
"id": "Quest+UserQuest", | |
"properties": { | |
"city_id": { | |
"type": "integer" | |
}, | |
"title": { | |
"type": "string" | |
}, | |
"description": { | |
"type": "string" | |
}, | |
"image": { | |
"type": "string" | |
}, | |
"video": { | |
"type": "string" | |
}, | |
"userQuest": { | |
"$ref": "UserQuest" | |
} | |
}, | |
"required": [ | |
"city_id", | |
"description", | |
"image", | |
"title" | |
] | |
}, | |
"UserQuest": { | |
"id": "UserQuest", | |
"properties": { | |
"id": { | |
"type": "integer" | |
}, | |
"user_id": { | |
"type": "integer" | |
}, | |
"progress": { | |
"type": "double" | |
}, | |
"quest_id": { | |
"type": "integer" | |
}, | |
"status": { | |
"type": "string" | |
} | |
}, | |
"required": [ | |
"id", | |
"progress", | |
"quest_id", | |
"status", | |
"user_id" | |
] | |
}, | |
"Quest+UserQuest+Missions+UserMission+Mechanics+UserMechanic": { | |
"id": "Quest+UserQuest+Missions+UserMission+Mechanics+UserMechanic", | |
"properties": { | |
"city_id": { | |
"type": "integer" | |
}, | |
"title": { | |
"type": "string" | |
}, | |
"description": { | |
"type": "string" | |
}, | |
"image": { | |
"type": "string" | |
}, | |
"video": { | |
"type": "string" | |
}, | |
"userQuest": { | |
"$ref": "UserQuest" | |
}, | |
"missions": { | |
"type": "array", | |
"items": { | |
"$ref": "Mission+UserMission+Mechanics+UserMechanic" | |
} | |
} | |
}, | |
"required": [ | |
"city_id", | |
"description", | |
"image", | |
"title" | |
] | |
}, | |
"Mission+UserMission+Mechanics+UserMechanic": { | |
"id": "Mission+UserMission+Mechanics+UserMechanic", | |
"properties": { | |
"title": { | |
"type": "string" | |
}, | |
"status": { | |
"type": "string", | |
"enum": [ | |
"hello_1", | |
"hello_2" | |
] | |
}, | |
"userMission": { | |
"$ref": "UserMission" | |
}, | |
"mechanics": { | |
"type": "array", | |
"items": { | |
"$ref": "Mechanic+UserMechanic" | |
} | |
} | |
}, | |
"required": [ | |
"status" | |
] | |
}, | |
"UserMission": { | |
"id": "UserMission", | |
"properties": { | |
"id": { | |
"type": "integer" | |
}, | |
"user_quest_id": { | |
"type": "integer" | |
}, | |
"mission_id": { | |
"type": "integer" | |
} | |
}, | |
"required": [ | |
"id", | |
"mission_id", | |
"user_quest_id" | |
] | |
}, | |
"Mechanic+UserMechanic": { | |
"id": "Mechanic+UserMechanic", | |
"properties": { | |
"title": { | |
"type": "string" | |
}, | |
"userMechanic": { | |
"$ref": "UserMechanic" | |
} | |
}, | |
"required": [ | |
"title" | |
] | |
}, | |
"UserMechanic": { | |
"id": "UserMechanic", | |
"properties": { | |
"id": { | |
"type": "integer" | |
}, | |
"user_mission_id": { | |
"type": "integer" | |
}, | |
"mechanic_id": { | |
"type": "integer" | |
}, | |
"answer": { | |
"type": "string" | |
}, | |
"status": { | |
"type": "string", | |
"enum": [ | |
"PENDING", | |
"PROCESSING", | |
"CORRECT", | |
"INCORRECT" | |
] | |
} | |
}, | |
"required": [ | |
"answer", | |
"id", | |
"mechanic_id", | |
"status", | |
"user_mission_id" | |
] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment