documentation-zero 0.0.6 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.documentation_api/sections/posts.md +17 -19
- data/Gemfile.lock +1 -1
- data/README.md +2 -2
- data/lib/documentation_zero/version.rb +1 -1
- data/lib/generators/documentation/scaffold/templates/resource.md.tt +15 -17
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25b3388ee2af025b7d1144d1f359c18ce4d75daf4d2d6e69845b4c642174cc43
|
4
|
+
data.tar.gz: 50e5e4c9b83f9a1315861cef29a97f1415394357adb82b97f69504a095ca7205
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f093fa94fd57cc9159a0130635164c468e2541744ecee8d7b9693569a9c04542179a65d37dcd07083ad4006c9e71b8a5b4d8e52dd035dde4f71a09e338f17cf
|
7
|
+
data.tar.gz: 0ae4198e2eca599ae54a4594692e712e31e42a33f62fb8a7cf497a40a7abb97bf75b64555f1606b57f3816a274bdfeceb9245809fc9aa97075316993d63dffaf
|
@@ -19,8 +19,8 @@ Models:
|
|
19
19
|
<!--
|
20
20
|
_Optional query parameters_:
|
21
21
|
|
22
|
-
* `attribute1` - when set to true, will only return resources that
|
23
|
-
* `attribute2` - when set to true, will only return resources that
|
22
|
+
* `attribute1` - when set to true, will only return resources that...
|
23
|
+
* `attribute2` - when set to true, will only return resources that...
|
24
24
|
-->
|
25
25
|
|
26
26
|
See the [Post model](#post-model) for more info on the response payload.
|
@@ -36,15 +36,20 @@ See the [Post model](#post-model) for more info on the response payload.
|
|
36
36
|
- `POST /posts.json` creates post.
|
37
37
|
|
38
38
|
<!--
|
39
|
-
**Required parameters**:
|
39
|
+
**Required parameters**:
|
40
|
+
|
41
|
+
* `title` - title of the post.
|
42
|
+
* `content` - content of the post.
|
43
|
+
* `published` - published of the post.
|
44
|
+
* `user_id` - user of the post.
|
40
45
|
-->
|
41
46
|
|
42
47
|
_Optional parameters_:
|
43
48
|
|
44
|
-
* `title` -
|
45
|
-
* `content` -
|
46
|
-
* `published` -
|
47
|
-
* `user_id` -
|
49
|
+
* `title` - title of the post.
|
50
|
+
* `content` - content of the post.
|
51
|
+
* `published` - published of the post.
|
52
|
+
* `user_id` - user of the post.
|
48
53
|
|
49
54
|
This endpoint will return `201 Created` with the current JSON representation of the post if the creation was a success. See the [Post model](#post-model) for more info on the payload.
|
50
55
|
|
@@ -52,18 +57,9 @@ This endpoint will return `201 Created` with the current JSON representation of
|
|
52
57
|
|
53
58
|
- `PUT /posts/1.json` allows changing the post with an ID of `1`.
|
54
59
|
|
55
|
-
|
56
|
-
|
57
|
-
<!--
|
58
|
-
**Required parameters**: `attribute1` and `attribute2`.
|
59
|
-
-->
|
60
|
-
|
61
|
-
_Optional parameters_:
|
60
|
+
You may change any of the required or optional parameters as listed in the [create post](#create-post) endpoint.
|
62
61
|
|
63
|
-
|
64
|
-
* `content` - attribute from post.
|
65
|
-
* `published` - attribute from post.
|
66
|
-
* `user_id` - attribute from post.
|
62
|
+
This endpoint will return `200 OK` with the current JSON representation of the post if the update was a success. See the [Post model](#post-model) for more info on the payload.
|
67
63
|
|
68
64
|
## Delete post
|
69
65
|
|
@@ -82,6 +78,8 @@ This endpoint will return `204 No Content` if successful. No parameters are requ
|
|
82
78
|
"title": "string",
|
83
79
|
"content": "string",
|
84
80
|
"published": "boolean",
|
85
|
-
"
|
81
|
+
"user_id": "integer",
|
82
|
+
"created_at": "datetime",
|
83
|
+
"updated_at": "datetime"
|
86
84
|
}
|
87
85
|
```
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -4,7 +4,7 @@ The purpose of documentation zero is to generate a scaffold for rails api docume
|
|
4
4
|
|
5
5
|
## Example
|
6
6
|
|
7
|
-
You can see an example of the generated documentation [here](.documentation_api/README.md)
|
7
|
+
You can see an example of the generated documentation [here](.documentation_api/README.md).
|
8
8
|
|
9
9
|
## Installation
|
10
10
|
|
@@ -24,7 +24,7 @@ rails generate documentation:readme
|
|
24
24
|
rails generate documentation:scaffold posts title:string body:text published:boolean user:references
|
25
25
|
```
|
26
26
|
|
27
|
-
Add
|
27
|
+
Add `- [Posts](sections/posts.md)` to API endpoints section.
|
28
28
|
|
29
29
|
## Development
|
30
30
|
|
@@ -19,8 +19,8 @@ Models:
|
|
19
19
|
<!--
|
20
20
|
_Optional query parameters_:
|
21
21
|
|
22
|
-
* `attribute1` - when set to true, will only return resources that
|
23
|
-
* `attribute2` - when set to true, will only return resources that
|
22
|
+
* `attribute1` - when set to true, will only return resources that...
|
23
|
+
* `attribute2` - when set to true, will only return resources that...
|
24
24
|
-->
|
25
25
|
|
26
26
|
See the [<%= class_name %> model](#<%= class_name.downcase %>-model) for more info on the response payload.
|
@@ -36,13 +36,17 @@ See the [<%= class_name %> model](#<%= class_name.downcase %>-model) for more in
|
|
36
36
|
- `POST /<%= plural_name %>.json` creates <%= human_name.downcase %>.
|
37
37
|
|
38
38
|
<!--
|
39
|
-
**Required parameters**:
|
39
|
+
**Required parameters**:
|
40
|
+
|
41
|
+
<% attributes.each do |attribute| -%>
|
42
|
+
* `<%= attribute.column_name %>` - <%= attribute.name.humanize(capitalize: false) %> of the <%= human_name.downcase %>.
|
43
|
+
<% end -%>
|
40
44
|
-->
|
41
45
|
|
42
46
|
_Optional parameters_:
|
43
47
|
|
44
48
|
<% attributes.each do |attribute| -%>
|
45
|
-
* `<%= attribute.column_name %>` - attribute
|
49
|
+
* `<%= attribute.column_name %>` - <%= attribute.name.humanize(capitalize: false) %> of the <%= human_name.downcase %>.
|
46
50
|
<% end -%>
|
47
51
|
|
48
52
|
This endpoint will return `201 Created` with the current JSON representation of the <%= human_name.downcase %> if the creation was a success. See the [<%= class_name %> model](#<%= class_name.downcase %>-model) for more info on the payload.
|
@@ -51,17 +55,9 @@ This endpoint will return `201 Created` with the current JSON representation of
|
|
51
55
|
|
52
56
|
- `PUT /<%= plural_name %>/1.json` allows changing the <%= human_name.downcase %> with an ID of `1`.
|
53
57
|
|
54
|
-
|
58
|
+
You may change any of the required or optional parameters as listed in the [create <%= human_name.downcase %>](#create-<%= singular_name.dasherize %>) endpoint.
|
55
59
|
|
56
|
-
|
57
|
-
**Required parameters**: `attribute1` and `attribute2`.
|
58
|
-
-->
|
59
|
-
|
60
|
-
_Optional parameters_:
|
61
|
-
|
62
|
-
<% attributes_names.each do |attribute| -%>
|
63
|
-
* `<%= attribute %>` - attribute from <%= human_name.downcase %>.
|
64
|
-
<% end -%>
|
60
|
+
This endpoint will return `200 OK` with the current JSON representation of the <%= human_name.downcase %> if the update was a success. See the [<%= class_name %> model](#<%= class_name.downcase %>-model) for more info on the payload.
|
65
61
|
|
66
62
|
## Delete <%= human_name.downcase %>
|
67
63
|
|
@@ -81,12 +77,14 @@ This endpoint will return `204 No Content` if successful. No parameters are requ
|
|
81
77
|
<% if attribute.password_digest? -%>
|
82
78
|
"password_digest": "string",
|
83
79
|
<% elsif attribute.token? -%>
|
84
|
-
"<%= attribute.
|
80
|
+
"<%= attribute.column_name %>": "string",
|
85
81
|
<% elsif attribute.reference? -%>
|
86
|
-
"<%= attribute.
|
82
|
+
"<%= attribute.column_name %>": "integer",
|
87
83
|
<% elsif !attribute.virtual? -%>
|
88
|
-
"<%= attribute.
|
84
|
+
"<%= attribute.column_name %>": "<%= attribute.type %>",
|
89
85
|
<% end -%>
|
90
86
|
<% end -%>
|
87
|
+
"created_at": "datetime",
|
88
|
+
"updated_at": "datetime"
|
91
89
|
}
|
92
90
|
```
|