documentation-zero 0.0.3 → 0.0.6
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/.documentation_api/sections/posts.md +15 -5
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/documentation_zero/version.rb +1 -1
- data/lib/generators/documentation/scaffold/templates/resource.md.tt +15 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4882b26240b6143fc91284a6b50e230a21fb3367ff223fbbf74b85b582622e67
|
4
|
+
data.tar.gz: c52ebd9ece21e06dd2397e6879ae07661d491198b8ef2a88169d929effb9b484
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1807652142ed5011dd35be639788c2bc651c35f08051d1f95a602deb68f59ff17fd49d87082fcc5189e7381669d4b18e6e26345ecb1b07696418d830992c3260
|
7
|
+
data.tar.gz: c42fc5525c9057585ee27103bb58a42650507835c5531c77589e00affdc1efc6ce0237d9ff8d3fcbad7c9579b1ac30bc607d84c468731e8814678023b6cf4dfb
|
@@ -8,6 +8,10 @@ Endpoints:
|
|
8
8
|
- [Update post](#update-post)
|
9
9
|
- [Delete post](#delete-post)
|
10
10
|
|
11
|
+
Models:
|
12
|
+
|
13
|
+
- [Post model](#post-model)
|
14
|
+
|
11
15
|
## Get posts
|
12
16
|
|
13
17
|
- `GET /posts.json` will return a [paginated list](../README.md#pagination) of posts.
|
@@ -19,13 +23,13 @@ _Optional query parameters_:
|
|
19
23
|
* `attribute2` - when set to true, will only return resources that are completed.
|
20
24
|
-->
|
21
25
|
|
22
|
-
See the [
|
26
|
+
See the [Post model](#post-model) for more info on the response payload.
|
23
27
|
|
24
28
|
## Get post
|
25
29
|
|
26
30
|
- `GET /posts/1.json` will return the post with an ID of `1`.
|
27
31
|
|
28
|
-
See the [
|
32
|
+
See the [Post model](#post-model) for more info on the response payload.
|
29
33
|
|
30
34
|
## Create post
|
31
35
|
|
@@ -40,14 +44,15 @@ _Optional parameters_:
|
|
40
44
|
* `title` - attribute from post.
|
41
45
|
* `content` - attribute from post.
|
42
46
|
* `published` - attribute from post.
|
47
|
+
* `user_id` - attribute from post.
|
43
48
|
|
44
|
-
This endpoint will return `201 Created` with the current JSON representation of the
|
49
|
+
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.
|
45
50
|
|
46
51
|
## Update post
|
47
52
|
|
48
53
|
- `PUT /posts/1.json` allows changing the post with an ID of `1`.
|
49
54
|
|
50
|
-
This endpoint will return `200 OK` with the current JSON representation of the
|
55
|
+
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.
|
51
56
|
|
52
57
|
<!--
|
53
58
|
**Required parameters**: `attribute1` and `attribute2`.
|
@@ -58,6 +63,7 @@ _Optional parameters_:
|
|
58
63
|
* `title` - attribute from post.
|
59
64
|
* `content` - attribute from post.
|
60
65
|
* `published` - attribute from post.
|
66
|
+
* `user_id` - attribute from post.
|
61
67
|
|
62
68
|
## Delete post
|
63
69
|
|
@@ -67,11 +73,15 @@ This endpoint will return `204 No Content` if successful. No parameters are requ
|
|
67
73
|
|
68
74
|
---
|
69
75
|
|
70
|
-
##
|
76
|
+
## Models
|
77
|
+
|
78
|
+
###### Post model
|
79
|
+
|
71
80
|
```json
|
72
81
|
{
|
73
82
|
"title": "string",
|
74
83
|
"content": "string",
|
75
84
|
"published": "boolean",
|
85
|
+
"user": "users.md#user-model",
|
76
86
|
}
|
77
87
|
```
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -21,7 +21,7 @@ rails generate documentation:readme
|
|
21
21
|
```
|
22
22
|
|
23
23
|
```
|
24
|
-
rails generate documentation:scaffold posts title:string body:text published:boolean
|
24
|
+
rails generate documentation:scaffold posts title:string body:text published:boolean user:references
|
25
25
|
```
|
26
26
|
|
27
27
|
Add ```- [Posts](sections/posts.md)``` to API endpoints section.
|
@@ -8,6 +8,10 @@ Endpoints:
|
|
8
8
|
- [Update <%= human_name.downcase %>](#update-<%= singular_name.dasherize %>)
|
9
9
|
- [Delete <%= human_name.downcase %>](#delete-<%= singular_name.dasherize %>)
|
10
10
|
|
11
|
+
Models:
|
12
|
+
|
13
|
+
- [<%= class_name %> model](#<%= singular_name.dasherize %>-model)
|
14
|
+
|
11
15
|
## Get <%= human_name.pluralize.downcase %>
|
12
16
|
|
13
17
|
- `GET /<%= plural_name %>.json` will return a [paginated list](../README.md#pagination) of <%= human_name.pluralize.downcase %>.
|
@@ -19,13 +23,13 @@ _Optional query parameters_:
|
|
19
23
|
* `attribute2` - when set to true, will only return resources that are completed.
|
20
24
|
-->
|
21
25
|
|
22
|
-
See the [<%=
|
26
|
+
See the [<%= class_name %> model](#<%= class_name.downcase %>-model) for more info on the response payload.
|
23
27
|
|
24
28
|
## Get <%= human_name.downcase %>
|
25
29
|
|
26
30
|
- `GET /<%= plural_name %>/1.json` will return the <%= human_name.downcase %> with an ID of `1`.
|
27
31
|
|
28
|
-
See the [<%=
|
32
|
+
See the [<%= class_name %> model](#<%= class_name.downcase %>-model) for more info on the response payload.
|
29
33
|
|
30
34
|
## Create <%= human_name.downcase %>
|
31
35
|
|
@@ -41,13 +45,13 @@ _Optional parameters_:
|
|
41
45
|
* `<%= attribute.column_name %>` - attribute from <%= human_name.downcase %>.
|
42
46
|
<% end -%>
|
43
47
|
|
44
|
-
This endpoint will return `201 Created` with the current JSON representation of the
|
48
|
+
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.
|
45
49
|
|
46
50
|
## Update <%= human_name.downcase %>
|
47
51
|
|
48
52
|
- `PUT /<%= plural_name %>/1.json` allows changing the <%= human_name.downcase %> with an ID of `1`.
|
49
53
|
|
50
|
-
This endpoint will return `200 OK` with the current JSON representation of the
|
54
|
+
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.
|
51
55
|
|
52
56
|
<!--
|
53
57
|
**Required parameters**: `attribute1` and `attribute2`.
|
@@ -67,18 +71,21 @@ This endpoint will return `204 No Content` if successful. No parameters are requ
|
|
67
71
|
|
68
72
|
---
|
69
73
|
|
70
|
-
##
|
74
|
+
## Models
|
75
|
+
|
76
|
+
###### <%= class_name %> model
|
77
|
+
|
71
78
|
```json
|
72
79
|
{
|
73
80
|
<% attributes.each do |attribute| -%>
|
74
81
|
<% if attribute.password_digest? -%>
|
75
82
|
"password_digest": "string",
|
76
83
|
<% elsif attribute.token? -%>
|
77
|
-
"<%= attribute.
|
84
|
+
"<%= attribute.name %>": "string",
|
78
85
|
<% elsif attribute.reference? -%>
|
79
|
-
"<%= attribute.
|
86
|
+
"<%= attribute.name %>": "<%= attribute.name.pluralize %>.md#<%= attribute.name.dasherize %>-model",
|
80
87
|
<% elsif !attribute.virtual? -%>
|
81
|
-
"<%= attribute.
|
88
|
+
"<%= attribute.name %>": "<%= attribute.type %>",
|
82
89
|
<% end -%>
|
83
90
|
<% end -%>
|
84
91
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: documentation-zero
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nixon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|