reqcord 0.1.1 → 0.1.3

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.
Files changed (229) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/Gemfile +5 -0
  4. data/README.md +13 -0
  5. data/docs/configuration.md +14 -0
  6. data/examples/reqcord.yml +4 -2
  7. data/gemfiles/rails_7.1.gemfile +13 -0
  8. data/gemfiles/rails_7.2.gemfile +13 -0
  9. data/gemfiles/rails_8.0.gemfile +13 -0
  10. data/gemfiles/rails_8.1.gemfile +13 -0
  11. data/lib/reqcord/configuration.rb +7 -1
  12. data/lib/reqcord/generator.rb +1 -1
  13. data/lib/reqcord/route_collector.rb +4 -2
  14. data/lib/reqcord/version.rb +1 -1
  15. data/lib/tasks/reqcord.rake +29 -2
  16. data/reqcord.gemspec +18 -4
  17. metadata +65 -217
  18. data/.gitignore +0 -8
  19. data/Gemfile.lock +0 -171
  20. data/examples/complex-spec-app/.rspec +0 -1
  21. data/examples/complex-spec-app/README.md +0 -21
  22. data/examples/complex-spec-app/app.rb +0 -363
  23. data/examples/complex-spec-app/docs/api/README.md +0 -104
  24. data/examples/complex-spec-app/docs/api/api/v1/admin/products/create.md +0 -117
  25. data/examples/complex-spec-app/docs/api/api/v1/admin/products/destroy.md +0 -51
  26. data/examples/complex-spec-app/docs/api/api/v1/admin/products/index.md +0 -11
  27. data/examples/complex-spec-app/docs/api/api/v1/admin/products/list.md +0 -106
  28. data/examples/complex-spec-app/docs/api/api/v1/auth/index.md +0 -9
  29. data/examples/complex-spec-app/docs/api/api/v1/auth/login.md +0 -76
  30. data/examples/complex-spec-app/docs/api/api/v1/cart-items/create.md +0 -91
  31. data/examples/complex-spec-app/docs/api/api/v1/cart-items/destroy.md +0 -51
  32. data/examples/complex-spec-app/docs/api/api/v1/cart-items/index.md +0 -10
  33. data/examples/complex-spec-app/docs/api/api/v1/carts/checkout.md +0 -102
  34. data/examples/complex-spec-app/docs/api/api/v1/carts/index.md +0 -10
  35. data/examples/complex-spec-app/docs/api/api/v1/carts/show.md +0 -73
  36. data/examples/complex-spec-app/docs/api/api/v1/home/index.md +0 -9
  37. data/examples/complex-spec-app/docs/api/api/v1/home/list.md +0 -47
  38. data/examples/complex-spec-app/docs/api/api/v1/notes/create.md +0 -94
  39. data/examples/complex-spec-app/docs/api/api/v1/notes/index.md +0 -10
  40. data/examples/complex-spec-app/docs/api/api/v1/notes/list.md +0 -61
  41. data/examples/complex-spec-app/docs/api/api/v1/orders/cancel.md +0 -69
  42. data/examples/complex-spec-app/docs/api/api/v1/orders/create.md +0 -150
  43. data/examples/complex-spec-app/docs/api/api/v1/orders/destroy.md +0 -37
  44. data/examples/complex-spec-app/docs/api/api/v1/orders/index.md +0 -13
  45. data/examples/complex-spec-app/docs/api/api/v1/orders/list.md +0 -78
  46. data/examples/complex-spec-app/docs/api/api/v1/orders/show.md +0 -83
  47. data/examples/complex-spec-app/docs/api/api/v1/products/index.md +0 -11
  48. data/examples/complex-spec-app/docs/api/api/v1/products/list.md +0 -83
  49. data/examples/complex-spec-app/docs/api/api/v1/products/search.md +0 -88
  50. data/examples/complex-spec-app/docs/api/api/v1/products/show.md +0 -71
  51. data/examples/complex-spec-app/docs/api/api/v1/profiles/index.md +0 -10
  52. data/examples/complex-spec-app/docs/api/api/v1/profiles/show.md +0 -61
  53. data/examples/complex-spec-app/docs/api/api/v1/profiles/update.md +0 -91
  54. data/examples/complex-spec-app/docs/api/api/v2/products/index.md +0 -9
  55. data/examples/complex-spec-app/docs/api/api/v2/products/list.md +0 -77
  56. data/examples/complex-spec-app/docs/api/curl/api/v1/admin/products/create.sh +0 -18
  57. data/examples/complex-spec-app/docs/api/curl/api/v1/admin/products/destroy.sh +0 -9
  58. data/examples/complex-spec-app/docs/api/curl/api/v1/admin/products/list.sh +0 -9
  59. data/examples/complex-spec-app/docs/api/curl/api/v1/auth/login.sh +0 -9
  60. data/examples/complex-spec-app/docs/api/curl/api/v1/cart-items/create.sh +0 -16
  61. data/examples/complex-spec-app/docs/api/curl/api/v1/cart-items/destroy.sh +0 -9
  62. data/examples/complex-spec-app/docs/api/curl/api/v1/carts/checkout.sh +0 -13
  63. data/examples/complex-spec-app/docs/api/curl/api/v1/carts/show.sh +0 -9
  64. data/examples/complex-spec-app/docs/api/curl/api/v1/home/list.sh +0 -8
  65. data/examples/complex-spec-app/docs/api/curl/api/v1/notes/create.sh +0 -15
  66. data/examples/complex-spec-app/docs/api/curl/api/v1/notes/list.sh +0 -9
  67. data/examples/complex-spec-app/docs/api/curl/api/v1/orders/cancel.sh +0 -9
  68. data/examples/complex-spec-app/docs/api/curl/api/v1/orders/create.sh +0 -29
  69. data/examples/complex-spec-app/docs/api/curl/api/v1/orders/destroy.sh +0 -9
  70. data/examples/complex-spec-app/docs/api/curl/api/v1/orders/list.sh +0 -9
  71. data/examples/complex-spec-app/docs/api/curl/api/v1/orders/show.sh +0 -9
  72. data/examples/complex-spec-app/docs/api/curl/api/v1/products/list.sh +0 -8
  73. data/examples/complex-spec-app/docs/api/curl/api/v1/products/search.sh +0 -8
  74. data/examples/complex-spec-app/docs/api/curl/api/v1/products/show.sh +0 -8
  75. data/examples/complex-spec-app/docs/api/curl/api/v1/profiles/show.sh +0 -9
  76. data/examples/complex-spec-app/docs/api/curl/api/v1/profiles/update.sh +0 -16
  77. data/examples/complex-spec-app/docs/api/curl/api/v2/products/list.sh +0 -8
  78. data/examples/complex-spec-app/docs/api/dataset.json +0 -5116
  79. data/examples/complex-spec-app/docs/api/postman/collection.json +0 -2519
  80. data/examples/complex-spec-app/generate.rb +0 -14
  81. data/examples/complex-spec-app/reqcord.yml +0 -28
  82. data/examples/complex-spec-app/spec/requests/admin_spec.rb +0 -67
  83. data/examples/complex-spec-app/spec/requests/cart_spec.rb +0 -61
  84. data/examples/complex-spec-app/spec/requests/home_and_auth_spec.rb +0 -49
  85. data/examples/complex-spec-app/spec/requests/orders_spec.rb +0 -124
  86. data/examples/complex-spec-app/spec/requests/products_spec.rb +0 -65
  87. data/examples/complex-spec-app/spec/spec_helper.rb +0 -17
  88. data/examples/complex-test-app/README.md +0 -40
  89. data/examples/complex-test-app/app.rb +0 -384
  90. data/examples/complex-test-app/docs/api/README.md +0 -104
  91. data/examples/complex-test-app/docs/api/api/v1/admin/products/create.md +0 -117
  92. data/examples/complex-test-app/docs/api/api/v1/admin/products/destroy.md +0 -51
  93. data/examples/complex-test-app/docs/api/api/v1/admin/products/index.md +0 -11
  94. data/examples/complex-test-app/docs/api/api/v1/admin/products/list.md +0 -106
  95. data/examples/complex-test-app/docs/api/api/v1/auth/index.md +0 -9
  96. data/examples/complex-test-app/docs/api/api/v1/auth/login.md +0 -76
  97. data/examples/complex-test-app/docs/api/api/v1/cart-items/create.md +0 -91
  98. data/examples/complex-test-app/docs/api/api/v1/cart-items/destroy.md +0 -51
  99. data/examples/complex-test-app/docs/api/api/v1/cart-items/index.md +0 -10
  100. data/examples/complex-test-app/docs/api/api/v1/carts/checkout.md +0 -102
  101. data/examples/complex-test-app/docs/api/api/v1/carts/index.md +0 -10
  102. data/examples/complex-test-app/docs/api/api/v1/carts/show.md +0 -73
  103. data/examples/complex-test-app/docs/api/api/v1/home/index.md +0 -9
  104. data/examples/complex-test-app/docs/api/api/v1/home/list.md +0 -47
  105. data/examples/complex-test-app/docs/api/api/v1/notes/create.md +0 -94
  106. data/examples/complex-test-app/docs/api/api/v1/notes/index.md +0 -10
  107. data/examples/complex-test-app/docs/api/api/v1/notes/list.md +0 -61
  108. data/examples/complex-test-app/docs/api/api/v1/orders/cancel.md +0 -69
  109. data/examples/complex-test-app/docs/api/api/v1/orders/create.md +0 -150
  110. data/examples/complex-test-app/docs/api/api/v1/orders/destroy.md +0 -37
  111. data/examples/complex-test-app/docs/api/api/v1/orders/index.md +0 -13
  112. data/examples/complex-test-app/docs/api/api/v1/orders/list.md +0 -71
  113. data/examples/complex-test-app/docs/api/api/v1/orders/show.md +0 -83
  114. data/examples/complex-test-app/docs/api/api/v1/products/index.md +0 -11
  115. data/examples/complex-test-app/docs/api/api/v1/products/list.md +0 -83
  116. data/examples/complex-test-app/docs/api/api/v1/products/search.md +0 -88
  117. data/examples/complex-test-app/docs/api/api/v1/products/show.md +0 -71
  118. data/examples/complex-test-app/docs/api/api/v1/profiles/index.md +0 -10
  119. data/examples/complex-test-app/docs/api/api/v1/profiles/show.md +0 -61
  120. data/examples/complex-test-app/docs/api/api/v1/profiles/update.md +0 -91
  121. data/examples/complex-test-app/docs/api/api/v2/products/index.md +0 -9
  122. data/examples/complex-test-app/docs/api/api/v2/products/list.md +0 -77
  123. data/examples/complex-test-app/docs/api/curl/api/v1/admin/products/create.sh +0 -18
  124. data/examples/complex-test-app/docs/api/curl/api/v1/admin/products/destroy.sh +0 -9
  125. data/examples/complex-test-app/docs/api/curl/api/v1/admin/products/list.sh +0 -9
  126. data/examples/complex-test-app/docs/api/curl/api/v1/auth/login.sh +0 -9
  127. data/examples/complex-test-app/docs/api/curl/api/v1/cart-items/create.sh +0 -16
  128. data/examples/complex-test-app/docs/api/curl/api/v1/cart-items/destroy.sh +0 -9
  129. data/examples/complex-test-app/docs/api/curl/api/v1/carts/checkout.sh +0 -13
  130. data/examples/complex-test-app/docs/api/curl/api/v1/carts/show.sh +0 -9
  131. data/examples/complex-test-app/docs/api/curl/api/v1/home/list.sh +0 -8
  132. data/examples/complex-test-app/docs/api/curl/api/v1/notes/create.sh +0 -15
  133. data/examples/complex-test-app/docs/api/curl/api/v1/notes/list.sh +0 -9
  134. data/examples/complex-test-app/docs/api/curl/api/v1/orders/cancel.sh +0 -9
  135. data/examples/complex-test-app/docs/api/curl/api/v1/orders/create.sh +0 -29
  136. data/examples/complex-test-app/docs/api/curl/api/v1/orders/destroy.sh +0 -9
  137. data/examples/complex-test-app/docs/api/curl/api/v1/orders/list.sh +0 -9
  138. data/examples/complex-test-app/docs/api/curl/api/v1/orders/show.sh +0 -9
  139. data/examples/complex-test-app/docs/api/curl/api/v1/products/list.sh +0 -8
  140. data/examples/complex-test-app/docs/api/curl/api/v1/products/search.sh +0 -8
  141. data/examples/complex-test-app/docs/api/curl/api/v1/products/show.sh +0 -8
  142. data/examples/complex-test-app/docs/api/curl/api/v1/profiles/show.sh +0 -9
  143. data/examples/complex-test-app/docs/api/curl/api/v1/profiles/update.sh +0 -16
  144. data/examples/complex-test-app/docs/api/curl/api/v2/products/list.sh +0 -8
  145. data/examples/complex-test-app/docs/api/dataset.json +0 -5109
  146. data/examples/complex-test-app/docs/api/postman/collection.json +0 -2568
  147. data/examples/complex-test-app/generate.rb +0 -14
  148. data/examples/complex-test-app/reqcord.yml +0 -28
  149. data/examples/complex-test-app/test/integration/admin_test.rb +0 -70
  150. data/examples/complex-test-app/test/integration/cart_test.rb +0 -64
  151. data/examples/complex-test-app/test/integration/home_and_auth_test.rb +0 -53
  152. data/examples/complex-test-app/test/integration/orders_test.rb +0 -127
  153. data/examples/complex-test-app/test/integration/products_test.rb +0 -66
  154. data/examples/spec-app/.rspec +0 -1
  155. data/examples/spec-app/README.md +0 -36
  156. data/examples/spec-app/app.rb +0 -209
  157. data/examples/spec-app/docs/api/README.md +0 -45
  158. data/examples/spec-app/docs/api/api/v1/customers/create.md +0 -95
  159. data/examples/spec-app/docs/api/api/v1/customers/index.md +0 -11
  160. data/examples/spec-app/docs/api/api/v1/customers/list.md +0 -67
  161. data/examples/spec-app/docs/api/api/v1/customers/show.md +0 -65
  162. data/examples/spec-app/docs/api/api/v1/tasks/complete.md +0 -51
  163. data/examples/spec-app/docs/api/api/v1/tasks/create.md +0 -90
  164. data/examples/spec-app/docs/api/api/v1/tasks/destroy.md +0 -35
  165. data/examples/spec-app/docs/api/api/v1/tasks/index.md +0 -14
  166. data/examples/spec-app/docs/api/api/v1/tasks/list.md +0 -65
  167. data/examples/spec-app/docs/api/api/v1/tasks/show.md +0 -65
  168. data/examples/spec-app/docs/api/api/v1/tasks/update.md +0 -74
  169. data/examples/spec-app/docs/api/api/v1/users/create.md +0 -95
  170. data/examples/spec-app/docs/api/api/v1/users/index.md +0 -11
  171. data/examples/spec-app/docs/api/api/v1/users/list.md +0 -67
  172. data/examples/spec-app/docs/api/api/v1/users/show.md +0 -65
  173. data/examples/spec-app/docs/api/curl/api/v1/customers/create.sh +0 -17
  174. data/examples/spec-app/docs/api/curl/api/v1/customers/list.sh +0 -9
  175. data/examples/spec-app/docs/api/curl/api/v1/customers/show.sh +0 -9
  176. data/examples/spec-app/docs/api/curl/api/v1/tasks/complete.sh +0 -8
  177. data/examples/spec-app/docs/api/curl/api/v1/tasks/create.sh +0 -15
  178. data/examples/spec-app/docs/api/curl/api/v1/tasks/destroy.sh +0 -8
  179. data/examples/spec-app/docs/api/curl/api/v1/tasks/list.sh +0 -8
  180. data/examples/spec-app/docs/api/curl/api/v1/tasks/show.sh +0 -8
  181. data/examples/spec-app/docs/api/curl/api/v1/tasks/update.sh +0 -14
  182. data/examples/spec-app/docs/api/curl/api/v1/users/create.sh +0 -17
  183. data/examples/spec-app/docs/api/curl/api/v1/users/list.sh +0 -9
  184. data/examples/spec-app/docs/api/curl/api/v1/users/show.sh +0 -9
  185. data/examples/spec-app/docs/api/dataset.json +0 -2402
  186. data/examples/spec-app/docs/api/postman/collection.json +0 -1290
  187. data/examples/spec-app/generate.rb +0 -14
  188. data/examples/spec-app/reqcord.yml +0 -27
  189. data/examples/spec-app/spec/requests/customers_spec.rb +0 -71
  190. data/examples/spec-app/spec/requests/tasks_spec.rb +0 -78
  191. data/examples/spec-app/spec/requests/users_spec.rb +0 -68
  192. data/examples/spec-app/spec/spec_helper.rb +0 -17
  193. data/examples/test-app/README.md +0 -57
  194. data/examples/test-app/app.rb +0 -212
  195. data/examples/test-app/docs/api/README.md +0 -45
  196. data/examples/test-app/docs/api/api/v1/customers/create.md +0 -95
  197. data/examples/test-app/docs/api/api/v1/customers/index.md +0 -11
  198. data/examples/test-app/docs/api/api/v1/customers/list.md +0 -67
  199. data/examples/test-app/docs/api/api/v1/customers/show.md +0 -65
  200. data/examples/test-app/docs/api/api/v1/tasks/complete.md +0 -51
  201. data/examples/test-app/docs/api/api/v1/tasks/create.md +0 -90
  202. data/examples/test-app/docs/api/api/v1/tasks/destroy.md +0 -35
  203. data/examples/test-app/docs/api/api/v1/tasks/index.md +0 -14
  204. data/examples/test-app/docs/api/api/v1/tasks/list.md +0 -65
  205. data/examples/test-app/docs/api/api/v1/tasks/show.md +0 -65
  206. data/examples/test-app/docs/api/api/v1/tasks/update.md +0 -74
  207. data/examples/test-app/docs/api/api/v1/users/create.md +0 -95
  208. data/examples/test-app/docs/api/api/v1/users/index.md +0 -11
  209. data/examples/test-app/docs/api/api/v1/users/list.md +0 -67
  210. data/examples/test-app/docs/api/api/v1/users/show.md +0 -65
  211. data/examples/test-app/docs/api/curl/api/v1/customers/create.sh +0 -17
  212. data/examples/test-app/docs/api/curl/api/v1/customers/list.sh +0 -9
  213. data/examples/test-app/docs/api/curl/api/v1/customers/show.sh +0 -9
  214. data/examples/test-app/docs/api/curl/api/v1/tasks/complete.sh +0 -8
  215. data/examples/test-app/docs/api/curl/api/v1/tasks/create.sh +0 -15
  216. data/examples/test-app/docs/api/curl/api/v1/tasks/destroy.sh +0 -8
  217. data/examples/test-app/docs/api/curl/api/v1/tasks/list.sh +0 -8
  218. data/examples/test-app/docs/api/curl/api/v1/tasks/show.sh +0 -8
  219. data/examples/test-app/docs/api/curl/api/v1/tasks/update.sh +0 -14
  220. data/examples/test-app/docs/api/curl/api/v1/users/create.sh +0 -17
  221. data/examples/test-app/docs/api/curl/api/v1/users/list.sh +0 -9
  222. data/examples/test-app/docs/api/curl/api/v1/users/show.sh +0 -9
  223. data/examples/test-app/docs/api/dataset.json +0 -2402
  224. data/examples/test-app/docs/api/postman/collection.json +0 -1290
  225. data/examples/test-app/generate.rb +0 -14
  226. data/examples/test-app/reqcord.yml +0 -28
  227. data/examples/test-app/test/integration/customers_test.rb +0 -72
  228. data/examples/test-app/test/integration/tasks_test.rb +0 -80
  229. data/examples/test-app/test/integration/users_test.rb +0 -72
@@ -1,95 +0,0 @@
1
- # Create User
2
-
3
- `POST /api/v1/users`
4
-
5
- Namespace: `api/v1`
6
-
7
- ## Headers
8
-
9
- | Header | Value |
10
- | --- | --- |
11
- | Authorization | `Bearer {{token}}` |
12
- | Content-Type | `application/json` |
13
- | Accept | `application/json` |
14
-
15
- ## Body Parameters
16
-
17
- | Field | Type | Required | Values |
18
- | --- | --- | --- | --- |
19
- | `user.name` | string | yes | `"Ada Lovelace"` |
20
- | `user.email` | string | yes | `"ada@example.com"` |
21
- | `user.status` | string | yes | `"active"` \| `"inactive"` |
22
-
23
- ## Example Request
24
-
25
- ```json
26
- {
27
- "user": {
28
- "name": "Ada Lovelace",
29
- "email": "ada@example.com",
30
- "status": "active"
31
- }
32
- }
33
- ```
34
-
35
- ## cURL
36
-
37
- ```bash
38
- curl --request POST \
39
- --url "http://localhost:3000/api/v1/users" \
40
- --header "Authorization: Bearer {{token}}" \
41
- --header "Content-Type: application/json" \
42
- --header "Accept: application/json" \
43
- --data '{
44
- "user": {
45
- "name": "Ada Lovelace",
46
- "email": "ada@example.com",
47
- "status": "active"
48
- }
49
- }'
50
- ```
51
-
52
- ## Responses
53
-
54
- ### 201 Created
55
-
56
- #### Fields
57
-
58
- | Field | Type | Required | Values |
59
- | --- | --- | --- | --- |
60
- | `id` | integer | yes | `3` |
61
- | `name` | string | yes | `"Ada Lovelace"` |
62
- | `email` | string | yes | `"ada@example.com"` |
63
- | `status` | string | yes | `"active"` \| `"inactive"` |
64
-
65
- ```json
66
- {
67
- "id": 3,
68
- "name": "Ada Lovelace",
69
- "email": "ada@example.com",
70
- "status": "active"
71
- }
72
- ```
73
-
74
- ### 422 Unprocessable Content
75
-
76
- #### Fields
77
-
78
- | Field | Type | Required | Values |
79
- | --- | --- | --- | --- |
80
- | `errors.status[]` | string | no | `"is not included in the list"` |
81
- | `errors.email[]` | string | no | `"can't be blank"` |
82
-
83
- ```json
84
- {
85
- "errors": {
86
- "status": [
87
- "is not included in the list"
88
- ]
89
- }
90
- }
91
- ```
92
-
93
- ---
94
-
95
- Resource: [Users](index.md)
@@ -1,11 +0,0 @@
1
- # Users
2
-
3
- Namespace: `api/v1`
4
-
5
- API version: `v1`
6
-
7
- | Method | Path | Description |
8
- | --- | --- | --- |
9
- | `GET` | [`/api/v1/users`](list.md) | List Users |
10
- | `POST` | [`/api/v1/users`](create.md) | Create User |
11
- | `GET` | [`/api/v1/users/:id`](show.md) | Get User |
@@ -1,67 +0,0 @@
1
- # List Users
2
-
3
- `GET /api/v1/users`
4
-
5
- Namespace: `api/v1`
6
-
7
- ## Headers
8
-
9
- | Header | Value |
10
- | --- | --- |
11
- | Authorization | `Bearer {{token}}` |
12
- | Accept | `application/json` |
13
-
14
- ## Query Parameters
15
-
16
- | Field | Type | Required | Values |
17
- | --- | --- | --- | --- |
18
- | `per_page` | integer | yes | `1` |
19
-
20
- ## cURL
21
-
22
- ```bash
23
- curl --request GET \
24
- --url "http://localhost:3000/api/v1/users?per_page=1" \
25
- --header "Authorization: Bearer {{token}}" \
26
- --header "Accept: application/json"
27
- ```
28
-
29
- ## Responses
30
-
31
- ### 200 OK
32
-
33
- #### Fields
34
-
35
- | Field | Type | Required | Values |
36
- | --- | --- | --- | --- |
37
- | `[].id` | integer | yes | `1` |
38
- | `[].name` | string | yes | `"John Doe"` |
39
- | `[].email` | string | yes | `"john@example.com"` |
40
-
41
- ```json
42
- [
43
- {
44
- "id": 1,
45
- "name": "John Doe",
46
- "email": "john@example.com"
47
- }
48
- ]
49
- ```
50
-
51
- ### 401 Unauthorized
52
-
53
- #### Fields
54
-
55
- | Field | Type | Required | Values |
56
- | --- | --- | --- | --- |
57
- | `error` | string | yes | `"Unauthorized"` |
58
-
59
- ```json
60
- {
61
- "error": "Unauthorized"
62
- }
63
- ```
64
-
65
- ---
66
-
67
- Resource: [Users](index.md)
@@ -1,65 +0,0 @@
1
- # Get User
2
-
3
- `GET /api/v1/users/:id`
4
-
5
- Namespace: `api/v1`
6
-
7
- ## Headers
8
-
9
- | Header | Value |
10
- | --- | --- |
11
- | Authorization | `Bearer {{token}}` |
12
- | Accept | `application/json` |
13
-
14
- ## Path Parameters
15
-
16
- | Field | Type | Required | Values |
17
- | --- | --- | --- | --- |
18
- | `id` | string | yes | `"1"` |
19
-
20
- ## cURL
21
-
22
- ```bash
23
- curl --request GET \
24
- --url "http://localhost:3000/api/v1/users/1" \
25
- --header "Authorization: Bearer {{token}}" \
26
- --header "Accept: application/json"
27
- ```
28
-
29
- ## Responses
30
-
31
- ### 200 OK
32
-
33
- #### Fields
34
-
35
- | Field | Type | Required | Values |
36
- | --- | --- | --- | --- |
37
- | `id` | integer | yes | `1` |
38
- | `name` | string | yes | `"John Doe"` |
39
- | `email` | string | yes | `"john@example.com"` |
40
-
41
- ```json
42
- {
43
- "id": 1,
44
- "name": "John Doe",
45
- "email": "john@example.com"
46
- }
47
- ```
48
-
49
- ### 404 Not Found
50
-
51
- #### Fields
52
-
53
- | Field | Type | Required | Values |
54
- | --- | --- | --- | --- |
55
- | `error` | string | yes | `"Not Found"` |
56
-
57
- ```json
58
- {
59
- "error": "Not Found"
60
- }
61
- ```
62
-
63
- ---
64
-
65
- Resource: [Users](index.md)
@@ -1,17 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- # Create Customer
5
- # POST /api/v1/customers
6
- curl --request POST \
7
- --url "http://localhost:3000/api/v1/customers" \
8
- --header "Authorization: Bearer {{token}}" \
9
- --header "Content-Type: application/json" \
10
- --header "Accept: application/json" \
11
- --data '{
12
- "customer": {
13
- "name": "Ada Lovelace",
14
- "email": "ada@example.com",
15
- "status": "active"
16
- }
17
- }'
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- # List Customers
5
- # GET /api/v1/customers
6
- curl --request GET \
7
- --url "http://localhost:3000/api/v1/customers?per_page=1" \
8
- --header "Authorization: Bearer {{token}}" \
9
- --header "Accept: application/json"
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- # Get Customer
5
- # GET /api/v1/customers/:id
6
- curl --request GET \
7
- --url "http://localhost:3000/api/v1/customers/1" \
8
- --header "Authorization: Bearer {{token}}" \
9
- --header "Accept: application/json"
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- # Complete Task
5
- # POST /api/v1/tasks/:id/complete
6
- curl --request POST \
7
- --url "http://localhost:3000/api/v1/tasks/1/complete" \
8
- --header "Accept: application/json"
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- # Create Task
5
- # POST /api/v1/tasks
6
- curl --request POST \
7
- --url "http://localhost:3000/api/v1/tasks" \
8
- --header "Content-Type: application/json" \
9
- --header "Accept: application/json" \
10
- --data '{
11
- "task": {
12
- "title": "Review the release",
13
- "priority": "high"
14
- }
15
- }'
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- # Delete Task
5
- # DELETE /api/v1/tasks/:id
6
- curl --request DELETE \
7
- --url "http://localhost:3000/api/v1/tasks/3" \
8
- --header "Accept: application/json"
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- # List Tasks
5
- # GET /api/v1/tasks
6
- curl --request GET \
7
- --url "http://localhost:3000/api/v1/tasks" \
8
- --header "Accept: application/json"
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- # Get Task
5
- # GET /api/v1/tasks/:id
6
- curl --request GET \
7
- --url "http://localhost:3000/api/v1/tasks/1" \
8
- --header "Accept: application/json"
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- # Update Task
5
- # PATCH /api/v1/tasks/:id
6
- curl --request PATCH \
7
- --url "http://localhost:3000/api/v1/tasks/1" \
8
- --header "Content-Type: application/json" \
9
- --header "Accept: application/json" \
10
- --data '{
11
- "task": {
12
- "title": "Write better docs"
13
- }
14
- }'
@@ -1,17 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- # Create User
5
- # POST /api/v1/users
6
- curl --request POST \
7
- --url "http://localhost:3000/api/v1/users" \
8
- --header "Authorization: Bearer {{token}}" \
9
- --header "Content-Type: application/json" \
10
- --header "Accept: application/json" \
11
- --data '{
12
- "user": {
13
- "name": "Ada Lovelace",
14
- "email": "ada@example.com",
15
- "status": "active"
16
- }
17
- }'
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- # List Users
5
- # GET /api/v1/users
6
- curl --request GET \
7
- --url "http://localhost:3000/api/v1/users?per_page=1" \
8
- --header "Authorization: Bearer {{token}}" \
9
- --header "Accept: application/json"
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- # Get User
5
- # GET /api/v1/users/:id
6
- curl --request GET \
7
- --url "http://localhost:3000/api/v1/users/1" \
8
- --header "Authorization: Bearer {{token}}" \
9
- --header "Accept: application/json"