-
Notifications
You must be signed in to change notification settings - Fork 50
/
sample.yml
120 lines (118 loc) · 3.52 KB
/
sample.yml
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: 'Calamum Rest Api'
url: 'http://calamum-sample:3000/api'
version: '1.0'
copyright: "2015"
description: 'Calamum is a simple ruby build program to generate a REST API documentation from a YAML file definition<br>testing tis thing <b> test bold </b>'
authentication: 'You authenticate to the Stripe API by providing one of your API keys in the request.<br> You can manage your API keys from your account. You can have multiple API keys active at one time. Your API keys carry many privileges, so be sure to keep them secret!'
errors:
http_errors:
-
code: 200
text: "OK"
description: "Success"
-
code: 304
text: "Not Modified"
description: "There was no new data to return."
-
code: 400
text: "Bad Request"
description: "The request was invalid or cannot be otherwise served"
api_errors:
-
code: 32
text: "Could not authenticate you"
description: "Your call could not be completed as dialed"
-
code: 34
text: "Sorry, that page does not exist"
description: "Corresponds with an HTTP 404 - the specified resource was not found."
-
code: 64
text: "Your account is suspended"
description: "Corresponds with an HTTP 403"
resources:
user:
-
uri: '/users'
action: 'get'
authentication: 'false'
headers:
content_type: 'application/json'
Accept: "application/vnd.example.v1"
description: 'Get the users list'
response: {"users":[{"id":"12354","name":"test", "mail":"[email protected]"}, {"id":"123789","name":"test2", "mail":"[email protected]"}]}
-
uri: '/users/:id'
action: 'get'
authentication: 'false'
headers:
content_type: 'application/json'
content_language: 'en-US'
params:
id:
type: 'String'
description: 'User id'
required: true
description: 'get the user'
response: {"user": {"name": "test", "mail": "[email protected]"}}
-
uri: '/users'
action: 'post'
description: 'Create a new user'
authentication: 'false'
headers:
content_type: 'application/json'
content_language: 'en-US'
params:
name:
type: 'String'
description: 'User name'
required: false
email:
type: 'String'
description: 'User email'
required: true
request: {"name": "test", "mail": "[email protected]"}
response: {"id": 12345, "name": "test", "mail": "[email protected]"}
-
uri: '/users/:id'
action: 'put'
description: 'Update the user'
headers:
content_type: 'application/json'
content_language: 'en-US'
params:
id:
type: 'String'
description: 'User id'
required: true
name:
type: 'String'
description: 'User name'
required: false
email:
type: 'String'
description: 'User email'
required: true
request: {"id": 12345, "name": "test", "mail": "[email protected]"}
response: {"id": 12345, "name": "test", "mail": "[email protected]"}
-
uri: '/users/:id'
action: 'delete'
description: 'Delete the user'
headers:
content_type: 'application/json'
content_language: 'en-US'
params:
id:
type: 'String'
description: 'User id'
required: true
group:
-
uri: '/groups'
action: 'get'
headers:
content_type: 'application/json'
description: 'Get the list of groups'