jdoc 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +35 -32
- data/example-api-documentation.md +13 -7
- data/lib/jdoc/link.rb +12 -0
- data/lib/jdoc/version.rb +1 -1
- data/template.md.erb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d15231d47a686a9226e686f608bed11b376f3368
|
4
|
+
data.tar.gz: 05a43e5ce89ec70fc444f7861fb9eec825f3990f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23cce94dbe1d36ae3524d3fe06e7626a7ce79fffc87ac089041cac4521197ee301407226aa01de4dc6bc28da93a22e0eb6a18978a7092e41c39296377335f4a5
|
7
|
+
data.tar.gz: 10c0212757b32120bef86909438ae78f15e198733bd49c4ab9ecffbb1cce1a876b476e603a04927911d12c68822888e5a8f9eafb165b2e78839fd6a995fff50f
|
data/CHANGELOG.md
CHANGED
@@ -1,87 +1,90 @@
|
|
1
|
+
## 0.4.2
|
2
|
+
- Show reason phrase in response example (Thx @minodisk)
|
3
|
+
|
1
4
|
## 0.4.1
|
2
|
-
|
5
|
+
- Use 204 for `mediaType: "null"`
|
3
6
|
|
4
7
|
## 0.4.0
|
5
|
-
|
8
|
+
- Recognize `mediaType: 'null'` as "No response body"
|
6
9
|
|
7
10
|
## 0.3.4
|
8
|
-
|
11
|
+
- Treat empty request parameters as no request body
|
9
12
|
|
10
13
|
## 0.3.3
|
11
|
-
|
14
|
+
- Improve pattern format in properties section
|
12
15
|
|
13
16
|
## 0.3.2
|
14
|
-
|
15
|
-
|
17
|
+
- Add generator options to change template
|
18
|
+
- Add request parameters for each endpoint
|
16
19
|
|
17
20
|
## 0.3.1
|
18
|
-
|
21
|
+
- Add error handling for ExampleNotFound
|
19
22
|
|
20
23
|
## 0.3.0
|
21
|
-
|
22
|
-
|
24
|
+
- Change example response status and body to PUT & DELETE requests
|
25
|
+
- Improve request path example by resolving variable in path
|
23
26
|
|
24
27
|
## 0.2.1
|
25
|
-
|
28
|
+
- Support multipart/form-data
|
26
29
|
|
27
30
|
## 0.2.0
|
28
|
-
|
31
|
+
- Show schema description on docs if exists
|
29
32
|
|
30
33
|
## 0.1.9
|
31
|
-
|
34
|
+
- Support property that has no type
|
32
35
|
|
33
36
|
## 0.1.8
|
34
|
-
|
37
|
+
- Support property that is an array of primitive values
|
35
38
|
|
36
39
|
## 0.1.7
|
37
|
-
|
38
|
-
|
40
|
+
- Support query string example in GET request
|
41
|
+
- Improve the description property visibility
|
39
42
|
|
40
43
|
## 0.1.6
|
41
|
-
|
44
|
+
- Disable `<em>` feature of Redcarpet
|
42
45
|
|
43
46
|
## 0.1.5
|
44
|
-
|
47
|
+
- Fix ToC link on HTML docs
|
45
48
|
|
46
49
|
## 0.1.4
|
47
|
-
|
50
|
+
- Provide :html option to render docs in HTML
|
48
51
|
|
49
52
|
## 0.1.3
|
50
|
-
|
53
|
+
- Use its pointer name if a resource has no title property
|
51
54
|
|
52
55
|
## 0.1.2
|
53
|
-
|
54
|
-
|
56
|
+
- Use .schema property for request body if exists
|
57
|
+
- Improve array resource handling
|
55
58
|
|
56
59
|
## 0.1.1
|
57
|
-
|
60
|
+
- Support has-one relation
|
58
61
|
|
59
62
|
## 0.1.0
|
60
|
-
|
63
|
+
- Show resources which have no links
|
61
64
|
|
62
65
|
## 0.0.9
|
63
|
-
|
66
|
+
- Support array property
|
64
67
|
|
65
68
|
## 0.0.8
|
66
|
-
|
69
|
+
- Fix resource equality
|
67
70
|
|
68
71
|
## 0.0.7
|
69
|
-
|
72
|
+
- Support `false` & `null` example value
|
70
73
|
|
71
74
|
## 0.0.6
|
72
|
-
|
75
|
+
- Use root API endpoint at example response
|
73
76
|
|
74
77
|
## 0.0.5
|
75
|
-
|
78
|
+
- Remove dependency on multi_json
|
76
79
|
|
77
80
|
## 0.0.4
|
78
|
-
|
81
|
+
- Support whitespace and multiple templates in href
|
79
82
|
|
80
83
|
## 0.0.3
|
81
|
-
|
84
|
+
- Fix missing gem dependencies
|
82
85
|
|
83
86
|
## 0.0.2
|
84
|
-
|
87
|
+
- Remove dependency on rack-spec
|
85
88
|
|
86
89
|
## 0.0.1
|
87
|
-
|
90
|
+
- 1st Release
|
@@ -60,8 +60,9 @@ Host: api.example.com
|
|
60
60
|
```
|
61
61
|
|
62
62
|
```
|
63
|
-
HTTP/1.1 201
|
63
|
+
HTTP/1.1 201 Created
|
64
64
|
Content-Type: application/json
|
65
|
+
|
65
66
|
{
|
66
67
|
"id": "01234567-89ab-cdef-0123-456789abcdef",
|
67
68
|
"name": "example",
|
@@ -87,7 +88,7 @@ Host: api.example.com
|
|
87
88
|
```
|
88
89
|
|
89
90
|
```
|
90
|
-
HTTP/1.1 204
|
91
|
+
HTTP/1.1 204 No Content
|
91
92
|
```
|
92
93
|
|
93
94
|
### GET /apps/:id
|
@@ -99,8 +100,9 @@ Host: api.example.com
|
|
99
100
|
```
|
100
101
|
|
101
102
|
```
|
102
|
-
HTTP/1.1 200
|
103
|
+
HTTP/1.1 200 OK
|
103
104
|
Content-Type: application/json
|
105
|
+
|
104
106
|
{
|
105
107
|
"id": "01234567-89ab-cdef-0123-456789abcdef",
|
106
108
|
"name": "example",
|
@@ -126,8 +128,9 @@ Host: api.example.com
|
|
126
128
|
```
|
127
129
|
|
128
130
|
```
|
129
|
-
HTTP/1.1 200
|
131
|
+
HTTP/1.1 200 OK
|
130
132
|
Content-Type: application/json
|
133
|
+
|
131
134
|
[
|
132
135
|
{
|
133
136
|
"id": "01234567-89ab-cdef-0123-456789abcdef",
|
@@ -166,8 +169,9 @@ Host: api.example.com
|
|
166
169
|
```
|
167
170
|
|
168
171
|
```
|
169
|
-
HTTP/1.1 200
|
172
|
+
HTTP/1.1 200 OK
|
170
173
|
Content-Type: application/json
|
174
|
+
|
171
175
|
{
|
172
176
|
"id": "01234567-89ab-cdef-0123-456789abcdef",
|
173
177
|
"name": "example",
|
@@ -205,8 +209,9 @@ Content-Disposition: form-data; name="[file]"
|
|
205
209
|
```
|
206
210
|
|
207
211
|
```
|
208
|
-
HTTP/1.1 201
|
212
|
+
HTTP/1.1 201 Created
|
209
213
|
Content-Type: application/json
|
214
|
+
|
210
215
|
{
|
211
216
|
"id": "01234567-89ab-cdef-0123-456789abcdef",
|
212
217
|
"name": "example",
|
@@ -241,8 +246,9 @@ Host: api.example.com
|
|
241
246
|
```
|
242
247
|
|
243
248
|
```
|
244
|
-
HTTP/1.1 200
|
249
|
+
HTTP/1.1 200 OK
|
245
250
|
Content-Type: application/json
|
251
|
+
|
246
252
|
[
|
247
253
|
{
|
248
254
|
"name": "Sushi",
|
data/lib/jdoc/link.rb
CHANGED
@@ -172,6 +172,18 @@ module Jdoc
|
|
172
172
|
end
|
173
173
|
end
|
174
174
|
|
175
|
+
# @return [String] Preferred respone reason phrase for this endpoint
|
176
|
+
def response_reason_phrase
|
177
|
+
case
|
178
|
+
when method == "POST"
|
179
|
+
"Created"
|
180
|
+
when has_response_body?
|
181
|
+
"OK"
|
182
|
+
else
|
183
|
+
"No Content"
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
175
187
|
# @return [JsonSchema::Schema] Response schema for this link
|
176
188
|
def response_schema
|
177
189
|
@raw_link.target_schema || @raw_link.parent
|
data/lib/jdoc/version.rb
CHANGED
data/template.md.erb
CHANGED
@@ -46,9 +46,9 @@ Host: <%= schema.host_with_port %>
|
|
46
46
|
```
|
47
47
|
|
48
48
|
```
|
49
|
-
HTTP/1.1 <%= link.response_status %>
|
49
|
+
HTTP/1.1 <%= link.response_status %> <%= link.response_reason_phrase %>
|
50
50
|
<%= "Content-Type: application/json" if link.has_response_body? -%>
|
51
|
-
<%= "\n#{link.response_body}\n" if link.has_response_body? -%>
|
51
|
+
<%= "\n\n#{link.response_body}\n" if link.has_response_body? -%>
|
52
52
|
```
|
53
53
|
|
54
54
|
<% end %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jdoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|