-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathapi-blueprint-spec.txt
107 lines (70 loc) · 1.95 KB
/
api-blueprint-spec.txt
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
Key:
-------------
< > = required, insert your replacement
eg. '<API title>' = 'Widget Monitoring API'
* * = optional
eg. '*(<content-type>)*' IN ['', 'application/json']
Structure:
-------------
FORMAT: 1A
HOST: https://<api-domain.net>
# <title>
<description>
# Group <name -resource-group>
<description>
## <name of resource> [</resource/uri/with/{<param>}]
<description>
+ Parameters
+ `<param>`: `<example value>` (<type, eg. string>) - <description>
+ Model (<content-type, eg. application/json>)
```<language, eg. js>
<example-structure, eg. { "temp": "21C" } >
```
### <request #1 title> [<request method, eg. GET>]
<description>
+ Response [status code, eg. 200]
[<resource name>][]
### <request #2 title> [<request method, eg. DELETE>]
<description>
+ Response <status code> *(<content-type, eg. text/plain>)*
+ Headers
<header, eg. X-Foo-Bar>: <example-value, eg. baz>
+ Body
<content in above content-type, eg. Hello, world!>
### <request #3 title> [<request method, eg. POST>]
<description>
+ Request (<content-type, eg. application/json>)
{
"<attr1>": <val1>,
"<attr2>": <val2>,
...
}
+ Response <status code>
```*<language, eg. js>*
{
"attr1": <val1>,
"attr2": <val2>,
...
}
```
## <resource name> [/uri{?<param>}]
<description>
+ Parameters
+ `param` (<required|optional>, <type, eg. number>, `<example value, eg. 1>`) ... <description>
### <request #1 title> [<request method, eg. PUT]
<description>
+ Request (<content-type, eg. application/json>)
+ Headers
<header, eg. X-Foo-Bar>: <example-value, eg. baz>
+ Body
{
"<attr1>": <val1>,
"<attr2>": <val2>,
...
}
+ Response 201
{
"<attr1>": <val1>,
"<attr2>": <val2>,
...
}