Add /player, /add_quest, /add_side_quest, responses.

This commit is contained in:
Ceda EI 2019-03-13 00:36:47 +05:30
parent 5d519f7d5c
commit ad57f67844
1 changed files with 122 additions and 0 deletions

122
docs.yml
View File

@ -21,6 +21,43 @@ paths:
schema:
$ref: '#/components/schemas/auth'
/player:
get:
summary: player
description: Get info about the user
parameters:
- $ref: '#/components/schemas/token'
responses:
200:
description: Player object
content:
application/json:
schema:
required:
- xp
- quests_completed
- total_quests
- side_quests_completed
- total_side_quests
properties:
xp:
description: Total experience of the player
type: integer
quests_completed:
description: Quests completed
type: integer
total_quests:
description: Total quests
type: integer
side_quests_completed:
description: Side Quests completed
type: integer
total_side_quests:
description: Total side quests
type: integer
401:
$ref: "#/components/responses/bad_auth"
/get_quests:
get:
summary: get_quests
@ -75,6 +112,8 @@ paths:
$ref: "#/components/responses/bad_request"
401:
$ref: "#/components/responses/bad_auth"
404:
$ref: "#/components/responses/doesnt_exist"
/get_side_quest:
get:
@ -94,6 +133,58 @@ paths:
$ref: "#/components/responses/bad_request"
401:
$ref: "#/components/responses/bad_auth"
404:
$ref: "#/components/responses/doesnt_exist"
/add_quest:
post:
summary: /add_quest
description: Add a quest
parameters:
- $ref: '#/components/schemas/token'
required: true
- $ref: '#/components/schemas/name'
required: true
- $ref: '#/components/schemas/priority'
required: true
- $ref: '#/components/schemas/difficulty'
required: true
responses:
200:
description: Returns the added Quest
content:
application/json:
schema:
$ref: '#/components/schemas/quests'
400:
$ref: "#/components/responses/bad_request"
401:
$ref: "#/components/responses/bad_auth"
/add_side_quest:
post:
summary: /add_side_quest
description: Add a side quest
parameters:
- $ref: '#/components/schemas/token'
required: true
- $ref: '#/components/schemas/name'
required: true
- $ref: '#/components/schemas/priority'
required: true
- $ref: '#/components/schemas/difficulty'
required: true
responses:
200:
description: Returns the added Side Quest
content:
application/json:
schema:
$ref: '#/components/schemas/quests'
400:
$ref: "#/components/responses/bad_request"
401:
$ref: "#/components/responses/bad_auth"
/update_quest:
post:
@ -117,6 +208,8 @@ paths:
$ref: "#/components/responses/bad_auth"
400:
$ref: "#/components/responses/bad_request"
404:
$ref: "#/components/responses/doesnt_exist"
/update_side_quest:
post:
@ -140,6 +233,8 @@ paths:
$ref: "#/components/responses/bad_auth"
400:
$ref: "#/components/responses/bad_request"
404:
$ref: "#/components/responses/doesnt_exist"
/delete_quest:
delete:
@ -151,6 +246,12 @@ paths:
responses:
200:
$ref: '#/components/responses/success'
400:
$ref: "#/components/responses/bad_request"
401:
$ref: "#/components/responses/bad_auth"
404:
$ref: "#/components/responses/doesnt_exist"
/delete_side_quest:
delete:
@ -162,6 +263,12 @@ paths:
responses:
200:
$ref: '#/components/responses/success'
400:
$ref: "#/components/responses/bad_request"
401:
$ref: "#/components/responses/bad_auth"
404:
$ref: "#/components/responses/doesnt_exist"
components:
schemas:
@ -187,11 +294,15 @@ components:
type: integer
quests:
required:
- id
- name
- difficulty
- priority
- state
properties:
id:
type: integer
description: ID of quest/side quest
name:
type: string
description: Name of the quest/side quest
@ -255,6 +366,17 @@ components:
error:
type: string
description: The token is invalid
doesnt_exist:
description: The quest/side quest doesn't exist
content:
application/json:
schema:
required:
- error
properties:
error:
type: string
description: The quest/side quest doesn't exist
success:
description: Returns the success / failure
content: