-
Notifications
You must be signed in to change notification settings - Fork 0
/
doc.raml
100 lines (100 loc) · 2.52 KB
/
doc.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
96
97
98
99
100
#%RAML 1.0
title: Users Services
version: 1
baseUri: http://localhost:3000/{version}
documentation:
- title: Welcome
content: An Node JS supercool REST API to administrate users
/users:
description: Endpoint to manage users.
post:
description: Creates an user
body:
application/json:
example:
{
"email": "[email protected]",
"password": "fidelio",
"name": "William"
}
responses:
201:
body:
application/json:
example:
{
"_id": "d456ee7d-6c27-4de0-8007-139ffe74ea2d",
"email": "[email protected]",
"name": "William",
"createdAt": "2019-12-30T00:00:00.000Z"
}
422:
body:
application/json:
example:
{
"errors": [{
"message": "error message"
}]
}
/{id}:
get:
description: Find user by id
responses:
200:
body:
application/json:
example:
{
"_id": "d456ee7d-6c27-4de0-8007-139ffe74ea2d",
"email": "[email protected]",
"name": "William",
"createdAt": "2019-12-30T00:00:00.000Z"
}
404:
body:
application/json:
example:
{
"errors": [{
"message": "user not found"
}]
}
put:
description: Edit an user
body:
application/json:
example:
{
"email": "[email protected]",
"password": "new_password",
"name": "New Name"
}
responses:
200:
body:
application/json:
example:
{
"_id": "d456ee7d-6c27-4de0-8007-139ffe74ea2d",
"email": "[email protected]",
"name": "New Name",
"createdAt": "2019-12-30T00:00:00.000Z"
}
/password/valid:
post:
description: Check if the password is valid
body:
application/json:
example:
{
"value": "fidelio"
}
responses:
200:
body:
application/json:
example:
{
"valid": true
}