documentation-zero 0.0.5 → 0.0.8

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: 2989992b190b783b8c1b3ce258176d949e229ce32bb7e045aa0257df0a084abd
4
- data.tar.gz: 828dd73c95fe502c16e0b871e75c197cff726cb5de25da3c0c5a669d7b4b2210
3
+ metadata.gz: ff0cfd8d7c31a648ac6ffb886529c5dbc3b52ec4b23cb5edff680332d6196823
4
+ data.tar.gz: 3e2452da26d4e5cdc39a86e94a0ce654becfc4e1e518512c16401caf57c737d2
5
5
  SHA512:
6
- metadata.gz: fa4e0d3497944a64a5a65f5a1a084d4db098c4ee299c6d5dce05dc134a0994c910aeb2a32cc9538e851d8f499ae7799753d62676c6eff42523cc19a32f7fc69c
7
- data.tar.gz: eb239336346a5209254083744c3c1ea257da446d3be6e78bbd5071a35be4fbe4d0c872e9ac248b2406ea664d5269b4562a84088bd97ea16e7bb60cd2ccf97215
6
+ metadata.gz: 9dda90a920a2e861c89419c0a8805eded8016f7f2944d7d5e276b6e60dcb3bd52f041aa7a7b5002a3adbb0e62a2711ad60abfd02d8cc9f4c1290800675b523fc
7
+ data.tar.gz: 3e3c0f3b5a7608f19d4606ef1d52b51518b82871891bb616716f4f68409c03c2f35c73fcf9246f0e27b402fd73c4ad7accfa6a31b095795f28f938d2a1780010
@@ -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.
@@ -15,49 +19,47 @@ Endpoints:
15
19
  <!--
16
20
  _Optional query parameters_:
17
21
 
18
- * `attribute1` - when set to true, will only return resources that are completed.
19
- * `attribute2` - when set to true, will only return resources that are completed.
22
+ * `attribute1` - when set to true, will only return resources that...
23
+ * `attribute2` - when set to true, will only return resources that...
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
 
32
36
  - `POST /posts.json` creates post.
33
37
 
34
38
  <!--
35
- **Required parameters**: `attribute1` and `attribute2`.
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.
36
45
  -->
37
46
 
38
47
  _Optional parameters_:
39
48
 
40
- * `title` - attribute from post.
41
- * `content` - attribute from post.
42
- * `published` - attribute from post.
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.
43
53
 
44
- This endpoint will return `201 Created` with the current JSON representation of the post if the creation was a success. See the [post](#model) model for more info on the payload.
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.
45
55
 
46
56
  ## Update post
47
57
 
48
58
  - `PUT /posts/1.json` allows changing the post with an ID of `1`.
49
59
 
50
- This endpoint will return `200 OK` with the current JSON representation of the post if the update was a success. See the [post](#model) model for more info on the payload.
51
-
52
- <!--
53
- **Required parameters**: `attribute1` and `attribute2`.
54
- -->
55
-
56
- _Optional parameters_:
60
+ You may change any of the required or optional parameters as listed in the [create post](#create-post) endpoint.
57
61
 
58
- * `title` - attribute from post.
59
- * `content` - attribute from post.
60
- * `published` - 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.
61
63
 
62
64
  ## Delete post
63
65
 
@@ -67,12 +69,15 @@ This endpoint will return `204 No Content` if successful. No parameters are requ
67
69
 
68
70
  ---
69
71
 
70
- ## Model
71
- ```mermaid
72
- classDiagram
73
- class Post {
74
- string title
75
- string content
76
- boolean published
72
+ ## Models
73
+
74
+ ###### Post model
75
+
76
+ ```json
77
+ {
78
+ "title": "string",
79
+ "content": "string",
80
+ "published": "boolean",
81
+ "user": "references",
77
82
  }
78
83
  ```
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- documentation-zero (0.0.5)
4
+ documentation-zero (0.0.8)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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
 
@@ -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.5"
2
+ VERSION = "0.0.8"
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 %>.
@@ -15,49 +19,45 @@ Endpoints:
15
19
  <!--
16
20
  _Optional query parameters_:
17
21
 
18
- * `attribute1` - when set to true, will only return resources that are completed.
19
- * `attribute2` - when set to true, will only return resources that are completed.
22
+ * `attribute1` - when set to true, will only return resources that...
23
+ * `attribute2` - when set to true, will only return resources that...
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
 
32
36
  - `POST /<%= plural_name %>.json` creates <%= human_name.downcase %>.
33
37
 
34
38
  <!--
35
- **Required parameters**: `attribute1` and `attribute2`.
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 -%>
36
44
  -->
37
45
 
38
46
  _Optional parameters_:
39
47
 
40
48
  <% attributes.each do |attribute| -%>
41
- * `<%= attribute.column_name %>` - attribute from <%= human_name.downcase %>.
49
+ * `<%= attribute.column_name %>` - <%= attribute.name.humanize(capitalize: false) %> of the <%= human_name.downcase %>.
42
50
  <% end -%>
43
51
 
44
- This endpoint will return `201 Created` with the current JSON representation of the <%= human_name.downcase %> if the creation was a success. See the [<%= human_name.downcase %>](#model) model for more info on the payload.
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.
45
53
 
46
54
  ## Update <%= human_name.downcase %>
47
55
 
48
56
  - `PUT /<%= plural_name %>/1.json` allows changing the <%= human_name.downcase %> with an ID of `1`.
49
57
 
50
- This endpoint will return `200 OK` with the current JSON representation of the <%= human_name.downcase %> if the update was a success. See the [<%= human_name.downcase %>](#model) model for more info on the payload.
58
+ You may change any of the required or optional parameters as listed in the [create <%= human_name.downcase %>](#create-<%= singular_name.dasherize %>) endpoint.
51
59
 
52
- <!--
53
- **Required parameters**: `attribute1` and `attribute2`.
54
- -->
55
-
56
- _Optional parameters_:
57
-
58
- <% attributes_names.each do |attribute| -%>
59
- * `<%= attribute %>` - attribute from <%= human_name.downcase %>.
60
- <% 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.
61
61
 
62
62
  ## Delete <%= human_name.downcase %>
63
63
 
@@ -67,19 +67,19 @@ This endpoint will return `204 No Content` if successful. No parameters are requ
67
67
 
68
68
  ---
69
69
 
70
- ## Model
71
- ```mermaid
72
- classDiagram
73
- class <%= class_name %> {
70
+ ## Models
71
+
72
+ ###### <%= class_name %> model
73
+
74
+ ```json
75
+ {
74
76
  <% attributes.each do |attribute| -%>
75
77
  <% if attribute.password_digest? -%>
76
- string password_digest
78
+ "password_digest": "string",
77
79
  <% elsif attribute.token? -%>
78
- string <%= attribute.column_name %>
79
- <% elsif attribute.reference? -%>
80
- integer <%= attribute.column_name %>
80
+ "<%= attribute.name %>": "string",
81
81
  <% elsif !attribute.virtual? -%>
82
- <%= attribute.type %> <%= attribute.column_name %>
82
+ "<%= attribute.name %>": "<%= attribute.type %>",
83
83
  <% end -%>
84
84
  <% end -%>
85
85
  }
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.5
4
+ version: 0.0.8
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: