-
Notifications
You must be signed in to change notification settings - Fork 1
/
api.raml
95 lines (92 loc) · 2.6 KB
/
api.raml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#%RAML 0.8
title: honor-for-all
version: v1
mediaType: application/json
protocols: [ HTTP, HTTPS ]
baseUri: https://localhos:8080/honor/api/{version}
/login
description: User authentication endpoint
type: item
post:
queryParameters:
login:
description: User login
type: string
required: false
example: "user_login_name"
password:
description: User password
type: string
required: false
example: "user_strong_password"
responses:
201:
body:
application/json:
schema: !include ../schema/vm/auth-token-vm.json
example: TODO add
400:
body:
application/json:
example: |
{
"message": "Login is not yet supported. Guest users only."
}
401:
body:
application/json:
example: |
{
"message": "Authorization failed: invalid login or password"
}
/hero:
description: Get Hero list (with ability to filter by hero id or class and retrieve partial payload).
type: bulk-collection
get:
queryParameters:
heroIds:
description: Specify comma separated list of Hero ids. If empty -- return all Heroes.
type: string
required: false
default: <empty>
example: "1,2,3"
classes:
description: If specified (one of [warrior, support, specialist, assassin]) will filter result set to include only Heroes of this class. If empty -- return all classes.
required: false
default: <empty>
example: "warrior,support"
include:
description: List of comma separated Hero fields. Can be one of [hero, spells]. Used to retrieve partial Hero data.
required: false
default: "hero"
exmaple: "hero,spells"
responses:
200:
body:
application/json:
schema: !include ../schema/vm/heroes-vm.json
example: TODO add
400:
body:
application/json:
example: |
{
"message": "Invalid input parameter [abc]. Expected numeric value."
}
/{heroId}:
description: Get Hero by id
type: item
get:
responses:
200:
body:
application/json:
schema: !include ../schema/vm/hero-vm.json
example: TODO add
404:
body:
application/json:
example: |
{
"message": "Fail to find Hero with id: 100500"
}