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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7d5ca3d94dfc5e43064e6ab72c119b1b70b9cd42d5253ccdbfda53adea386a0
4
- data.tar.gz: 4eb89e52a8516a08b270595d79a517f23c964a9e49d726c5762835d218c221a5
3
+ metadata.gz: 4882b26240b6143fc91284a6b50e230a21fb3367ff223fbbf74b85b582622e67
4
+ data.tar.gz: c52ebd9ece21e06dd2397e6879ae07661d491198b8ef2a88169d929effb9b484
5
5
  SHA512:
6
- metadata.gz: 3ec941e03d9adfbd750849f9ad4455b7d873df56fddf7dd9bebd6c518ee0b92fdab3074242b3d164872f9845512386743baa6dd17ef41183561a8bc0f2cf24a3
7
- data.tar.gz: 779c760f21f1b41b765c08aea28b4930620d91810866026b067b0e3e4fe9ffa7a539c3ce59b8167fbd6f255ea5fd60dac5568b83b29340555b4e144394234af3
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 [post](#model) model for more info on the response payload.
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 [post](#model) model for more info on the response payload.
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 [post](#model) if the creation was a success.
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 [post](#model) if the update was a success.
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
- ## Model
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- documentation-zero (0.0.3)
4
+ documentation-zero (0.0.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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.
@@ -1,3 +1,3 @@
1
1
  module DocumentationZero
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -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 [<%= human_name.downcase %>](#model) model for more info on the response payload.
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 [<%= human_name.downcase %>](#model) model for more info on the response payload.
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 [<%= human_name.downcase %>](#model) if the creation was a success.
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 [<%= human_name.downcase %>](#model) if the update was a success.
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
- ## Model
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.column_name %>": "string",
84
+ "<%= attribute.name %>": "string",
78
85
  <% elsif attribute.reference? -%>
79
- "<%= attribute.column_name %>": "integer",
86
+ "<%= attribute.name %>": "<%= attribute.name.pluralize %>.md#<%= attribute.name.dasherize %>-model",
80
87
  <% elsif !attribute.virtual? -%>
81
- "<%= attribute.column_name %>": "<%= attribute.type %>",
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.3
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-18 00:00:00.000000000 Z
11
+ date: 2022-03-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: