reqcord 0.1.1 → 0.1.2

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 (223) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -0
  3. data/Gemfile +5 -0
  4. data/README.md +13 -0
  5. data/gemfiles/rails_7.1.gemfile +13 -0
  6. data/gemfiles/rails_7.2.gemfile +13 -0
  7. data/gemfiles/rails_8.0.gemfile +13 -0
  8. data/gemfiles/rails_8.1.gemfile +13 -0
  9. data/lib/reqcord/version.rb +1 -1
  10. data/reqcord.gemspec +18 -4
  11. metadata +65 -217
  12. data/.gitignore +0 -8
  13. data/Gemfile.lock +0 -171
  14. data/examples/complex-spec-app/.rspec +0 -1
  15. data/examples/complex-spec-app/README.md +0 -21
  16. data/examples/complex-spec-app/app.rb +0 -363
  17. data/examples/complex-spec-app/docs/api/README.md +0 -104
  18. data/examples/complex-spec-app/docs/api/api/v1/admin/products/create.md +0 -117
  19. data/examples/complex-spec-app/docs/api/api/v1/admin/products/destroy.md +0 -51
  20. data/examples/complex-spec-app/docs/api/api/v1/admin/products/index.md +0 -11
  21. data/examples/complex-spec-app/docs/api/api/v1/admin/products/list.md +0 -106
  22. data/examples/complex-spec-app/docs/api/api/v1/auth/index.md +0 -9
  23. data/examples/complex-spec-app/docs/api/api/v1/auth/login.md +0 -76
  24. data/examples/complex-spec-app/docs/api/api/v1/cart-items/create.md +0 -91
  25. data/examples/complex-spec-app/docs/api/api/v1/cart-items/destroy.md +0 -51
  26. data/examples/complex-spec-app/docs/api/api/v1/cart-items/index.md +0 -10
  27. data/examples/complex-spec-app/docs/api/api/v1/carts/checkout.md +0 -102
  28. data/examples/complex-spec-app/docs/api/api/v1/carts/index.md +0 -10
  29. data/examples/complex-spec-app/docs/api/api/v1/carts/show.md +0 -73
  30. data/examples/complex-spec-app/docs/api/api/v1/home/index.md +0 -9
  31. data/examples/complex-spec-app/docs/api/api/v1/home/list.md +0 -47
  32. data/examples/complex-spec-app/docs/api/api/v1/notes/create.md +0 -94
  33. data/examples/complex-spec-app/docs/api/api/v1/notes/index.md +0 -10
  34. data/examples/complex-spec-app/docs/api/api/v1/notes/list.md +0 -61
  35. data/examples/complex-spec-app/docs/api/api/v1/orders/cancel.md +0 -69
  36. data/examples/complex-spec-app/docs/api/api/v1/orders/create.md +0 -150
  37. data/examples/complex-spec-app/docs/api/api/v1/orders/destroy.md +0 -37
  38. data/examples/complex-spec-app/docs/api/api/v1/orders/index.md +0 -13
  39. data/examples/complex-spec-app/docs/api/api/v1/orders/list.md +0 -78
  40. data/examples/complex-spec-app/docs/api/api/v1/orders/show.md +0 -83
  41. data/examples/complex-spec-app/docs/api/api/v1/products/index.md +0 -11
  42. data/examples/complex-spec-app/docs/api/api/v1/products/list.md +0 -83
  43. data/examples/complex-spec-app/docs/api/api/v1/products/search.md +0 -88
  44. data/examples/complex-spec-app/docs/api/api/v1/products/show.md +0 -71
  45. data/examples/complex-spec-app/docs/api/api/v1/profiles/index.md +0 -10
  46. data/examples/complex-spec-app/docs/api/api/v1/profiles/show.md +0 -61
  47. data/examples/complex-spec-app/docs/api/api/v1/profiles/update.md +0 -91
  48. data/examples/complex-spec-app/docs/api/api/v2/products/index.md +0 -9
  49. data/examples/complex-spec-app/docs/api/api/v2/products/list.md +0 -77
  50. data/examples/complex-spec-app/docs/api/curl/api/v1/admin/products/create.sh +0 -18
  51. data/examples/complex-spec-app/docs/api/curl/api/v1/admin/products/destroy.sh +0 -9
  52. data/examples/complex-spec-app/docs/api/curl/api/v1/admin/products/list.sh +0 -9
  53. data/examples/complex-spec-app/docs/api/curl/api/v1/auth/login.sh +0 -9
  54. data/examples/complex-spec-app/docs/api/curl/api/v1/cart-items/create.sh +0 -16
  55. data/examples/complex-spec-app/docs/api/curl/api/v1/cart-items/destroy.sh +0 -9
  56. data/examples/complex-spec-app/docs/api/curl/api/v1/carts/checkout.sh +0 -13
  57. data/examples/complex-spec-app/docs/api/curl/api/v1/carts/show.sh +0 -9
  58. data/examples/complex-spec-app/docs/api/curl/api/v1/home/list.sh +0 -8
  59. data/examples/complex-spec-app/docs/api/curl/api/v1/notes/create.sh +0 -15
  60. data/examples/complex-spec-app/docs/api/curl/api/v1/notes/list.sh +0 -9
  61. data/examples/complex-spec-app/docs/api/curl/api/v1/orders/cancel.sh +0 -9
  62. data/examples/complex-spec-app/docs/api/curl/api/v1/orders/create.sh +0 -29
  63. data/examples/complex-spec-app/docs/api/curl/api/v1/orders/destroy.sh +0 -9
  64. data/examples/complex-spec-app/docs/api/curl/api/v1/orders/list.sh +0 -9
  65. data/examples/complex-spec-app/docs/api/curl/api/v1/orders/show.sh +0 -9
  66. data/examples/complex-spec-app/docs/api/curl/api/v1/products/list.sh +0 -8
  67. data/examples/complex-spec-app/docs/api/curl/api/v1/products/search.sh +0 -8
  68. data/examples/complex-spec-app/docs/api/curl/api/v1/products/show.sh +0 -8
  69. data/examples/complex-spec-app/docs/api/curl/api/v1/profiles/show.sh +0 -9
  70. data/examples/complex-spec-app/docs/api/curl/api/v1/profiles/update.sh +0 -16
  71. data/examples/complex-spec-app/docs/api/curl/api/v2/products/list.sh +0 -8
  72. data/examples/complex-spec-app/docs/api/dataset.json +0 -5116
  73. data/examples/complex-spec-app/docs/api/postman/collection.json +0 -2519
  74. data/examples/complex-spec-app/generate.rb +0 -14
  75. data/examples/complex-spec-app/reqcord.yml +0 -28
  76. data/examples/complex-spec-app/spec/requests/admin_spec.rb +0 -67
  77. data/examples/complex-spec-app/spec/requests/cart_spec.rb +0 -61
  78. data/examples/complex-spec-app/spec/requests/home_and_auth_spec.rb +0 -49
  79. data/examples/complex-spec-app/spec/requests/orders_spec.rb +0 -124
  80. data/examples/complex-spec-app/spec/requests/products_spec.rb +0 -65
  81. data/examples/complex-spec-app/spec/spec_helper.rb +0 -17
  82. data/examples/complex-test-app/README.md +0 -40
  83. data/examples/complex-test-app/app.rb +0 -384
  84. data/examples/complex-test-app/docs/api/README.md +0 -104
  85. data/examples/complex-test-app/docs/api/api/v1/admin/products/create.md +0 -117
  86. data/examples/complex-test-app/docs/api/api/v1/admin/products/destroy.md +0 -51
  87. data/examples/complex-test-app/docs/api/api/v1/admin/products/index.md +0 -11
  88. data/examples/complex-test-app/docs/api/api/v1/admin/products/list.md +0 -106
  89. data/examples/complex-test-app/docs/api/api/v1/auth/index.md +0 -9
  90. data/examples/complex-test-app/docs/api/api/v1/auth/login.md +0 -76
  91. data/examples/complex-test-app/docs/api/api/v1/cart-items/create.md +0 -91
  92. data/examples/complex-test-app/docs/api/api/v1/cart-items/destroy.md +0 -51
  93. data/examples/complex-test-app/docs/api/api/v1/cart-items/index.md +0 -10
  94. data/examples/complex-test-app/docs/api/api/v1/carts/checkout.md +0 -102
  95. data/examples/complex-test-app/docs/api/api/v1/carts/index.md +0 -10
  96. data/examples/complex-test-app/docs/api/api/v1/carts/show.md +0 -73
  97. data/examples/complex-test-app/docs/api/api/v1/home/index.md +0 -9
  98. data/examples/complex-test-app/docs/api/api/v1/home/list.md +0 -47
  99. data/examples/complex-test-app/docs/api/api/v1/notes/create.md +0 -94
  100. data/examples/complex-test-app/docs/api/api/v1/notes/index.md +0 -10
  101. data/examples/complex-test-app/docs/api/api/v1/notes/list.md +0 -61
  102. data/examples/complex-test-app/docs/api/api/v1/orders/cancel.md +0 -69
  103. data/examples/complex-test-app/docs/api/api/v1/orders/create.md +0 -150
  104. data/examples/complex-test-app/docs/api/api/v1/orders/destroy.md +0 -37
  105. data/examples/complex-test-app/docs/api/api/v1/orders/index.md +0 -13
  106. data/examples/complex-test-app/docs/api/api/v1/orders/list.md +0 -71
  107. data/examples/complex-test-app/docs/api/api/v1/orders/show.md +0 -83
  108. data/examples/complex-test-app/docs/api/api/v1/products/index.md +0 -11
  109. data/examples/complex-test-app/docs/api/api/v1/products/list.md +0 -83
  110. data/examples/complex-test-app/docs/api/api/v1/products/search.md +0 -88
  111. data/examples/complex-test-app/docs/api/api/v1/products/show.md +0 -71
  112. data/examples/complex-test-app/docs/api/api/v1/profiles/index.md +0 -10
  113. data/examples/complex-test-app/docs/api/api/v1/profiles/show.md +0 -61
  114. data/examples/complex-test-app/docs/api/api/v1/profiles/update.md +0 -91
  115. data/examples/complex-test-app/docs/api/api/v2/products/index.md +0 -9
  116. data/examples/complex-test-app/docs/api/api/v2/products/list.md +0 -77
  117. data/examples/complex-test-app/docs/api/curl/api/v1/admin/products/create.sh +0 -18
  118. data/examples/complex-test-app/docs/api/curl/api/v1/admin/products/destroy.sh +0 -9
  119. data/examples/complex-test-app/docs/api/curl/api/v1/admin/products/list.sh +0 -9
  120. data/examples/complex-test-app/docs/api/curl/api/v1/auth/login.sh +0 -9
  121. data/examples/complex-test-app/docs/api/curl/api/v1/cart-items/create.sh +0 -16
  122. data/examples/complex-test-app/docs/api/curl/api/v1/cart-items/destroy.sh +0 -9
  123. data/examples/complex-test-app/docs/api/curl/api/v1/carts/checkout.sh +0 -13
  124. data/examples/complex-test-app/docs/api/curl/api/v1/carts/show.sh +0 -9
  125. data/examples/complex-test-app/docs/api/curl/api/v1/home/list.sh +0 -8
  126. data/examples/complex-test-app/docs/api/curl/api/v1/notes/create.sh +0 -15
  127. data/examples/complex-test-app/docs/api/curl/api/v1/notes/list.sh +0 -9
  128. data/examples/complex-test-app/docs/api/curl/api/v1/orders/cancel.sh +0 -9
  129. data/examples/complex-test-app/docs/api/curl/api/v1/orders/create.sh +0 -29
  130. data/examples/complex-test-app/docs/api/curl/api/v1/orders/destroy.sh +0 -9
  131. data/examples/complex-test-app/docs/api/curl/api/v1/orders/list.sh +0 -9
  132. data/examples/complex-test-app/docs/api/curl/api/v1/orders/show.sh +0 -9
  133. data/examples/complex-test-app/docs/api/curl/api/v1/products/list.sh +0 -8
  134. data/examples/complex-test-app/docs/api/curl/api/v1/products/search.sh +0 -8
  135. data/examples/complex-test-app/docs/api/curl/api/v1/products/show.sh +0 -8
  136. data/examples/complex-test-app/docs/api/curl/api/v1/profiles/show.sh +0 -9
  137. data/examples/complex-test-app/docs/api/curl/api/v1/profiles/update.sh +0 -16
  138. data/examples/complex-test-app/docs/api/curl/api/v2/products/list.sh +0 -8
  139. data/examples/complex-test-app/docs/api/dataset.json +0 -5109
  140. data/examples/complex-test-app/docs/api/postman/collection.json +0 -2568
  141. data/examples/complex-test-app/generate.rb +0 -14
  142. data/examples/complex-test-app/reqcord.yml +0 -28
  143. data/examples/complex-test-app/test/integration/admin_test.rb +0 -70
  144. data/examples/complex-test-app/test/integration/cart_test.rb +0 -64
  145. data/examples/complex-test-app/test/integration/home_and_auth_test.rb +0 -53
  146. data/examples/complex-test-app/test/integration/orders_test.rb +0 -127
  147. data/examples/complex-test-app/test/integration/products_test.rb +0 -66
  148. data/examples/spec-app/.rspec +0 -1
  149. data/examples/spec-app/README.md +0 -36
  150. data/examples/spec-app/app.rb +0 -209
  151. data/examples/spec-app/docs/api/README.md +0 -45
  152. data/examples/spec-app/docs/api/api/v1/customers/create.md +0 -95
  153. data/examples/spec-app/docs/api/api/v1/customers/index.md +0 -11
  154. data/examples/spec-app/docs/api/api/v1/customers/list.md +0 -67
  155. data/examples/spec-app/docs/api/api/v1/customers/show.md +0 -65
  156. data/examples/spec-app/docs/api/api/v1/tasks/complete.md +0 -51
  157. data/examples/spec-app/docs/api/api/v1/tasks/create.md +0 -90
  158. data/examples/spec-app/docs/api/api/v1/tasks/destroy.md +0 -35
  159. data/examples/spec-app/docs/api/api/v1/tasks/index.md +0 -14
  160. data/examples/spec-app/docs/api/api/v1/tasks/list.md +0 -65
  161. data/examples/spec-app/docs/api/api/v1/tasks/show.md +0 -65
  162. data/examples/spec-app/docs/api/api/v1/tasks/update.md +0 -74
  163. data/examples/spec-app/docs/api/api/v1/users/create.md +0 -95
  164. data/examples/spec-app/docs/api/api/v1/users/index.md +0 -11
  165. data/examples/spec-app/docs/api/api/v1/users/list.md +0 -67
  166. data/examples/spec-app/docs/api/api/v1/users/show.md +0 -65
  167. data/examples/spec-app/docs/api/curl/api/v1/customers/create.sh +0 -17
  168. data/examples/spec-app/docs/api/curl/api/v1/customers/list.sh +0 -9
  169. data/examples/spec-app/docs/api/curl/api/v1/customers/show.sh +0 -9
  170. data/examples/spec-app/docs/api/curl/api/v1/tasks/complete.sh +0 -8
  171. data/examples/spec-app/docs/api/curl/api/v1/tasks/create.sh +0 -15
  172. data/examples/spec-app/docs/api/curl/api/v1/tasks/destroy.sh +0 -8
  173. data/examples/spec-app/docs/api/curl/api/v1/tasks/list.sh +0 -8
  174. data/examples/spec-app/docs/api/curl/api/v1/tasks/show.sh +0 -8
  175. data/examples/spec-app/docs/api/curl/api/v1/tasks/update.sh +0 -14
  176. data/examples/spec-app/docs/api/curl/api/v1/users/create.sh +0 -17
  177. data/examples/spec-app/docs/api/curl/api/v1/users/list.sh +0 -9
  178. data/examples/spec-app/docs/api/curl/api/v1/users/show.sh +0 -9
  179. data/examples/spec-app/docs/api/dataset.json +0 -2402
  180. data/examples/spec-app/docs/api/postman/collection.json +0 -1290
  181. data/examples/spec-app/generate.rb +0 -14
  182. data/examples/spec-app/reqcord.yml +0 -27
  183. data/examples/spec-app/spec/requests/customers_spec.rb +0 -71
  184. data/examples/spec-app/spec/requests/tasks_spec.rb +0 -78
  185. data/examples/spec-app/spec/requests/users_spec.rb +0 -68
  186. data/examples/spec-app/spec/spec_helper.rb +0 -17
  187. data/examples/test-app/README.md +0 -57
  188. data/examples/test-app/app.rb +0 -212
  189. data/examples/test-app/docs/api/README.md +0 -45
  190. data/examples/test-app/docs/api/api/v1/customers/create.md +0 -95
  191. data/examples/test-app/docs/api/api/v1/customers/index.md +0 -11
  192. data/examples/test-app/docs/api/api/v1/customers/list.md +0 -67
  193. data/examples/test-app/docs/api/api/v1/customers/show.md +0 -65
  194. data/examples/test-app/docs/api/api/v1/tasks/complete.md +0 -51
  195. data/examples/test-app/docs/api/api/v1/tasks/create.md +0 -90
  196. data/examples/test-app/docs/api/api/v1/tasks/destroy.md +0 -35
  197. data/examples/test-app/docs/api/api/v1/tasks/index.md +0 -14
  198. data/examples/test-app/docs/api/api/v1/tasks/list.md +0 -65
  199. data/examples/test-app/docs/api/api/v1/tasks/show.md +0 -65
  200. data/examples/test-app/docs/api/api/v1/tasks/update.md +0 -74
  201. data/examples/test-app/docs/api/api/v1/users/create.md +0 -95
  202. data/examples/test-app/docs/api/api/v1/users/index.md +0 -11
  203. data/examples/test-app/docs/api/api/v1/users/list.md +0 -67
  204. data/examples/test-app/docs/api/api/v1/users/show.md +0 -65
  205. data/examples/test-app/docs/api/curl/api/v1/customers/create.sh +0 -17
  206. data/examples/test-app/docs/api/curl/api/v1/customers/list.sh +0 -9
  207. data/examples/test-app/docs/api/curl/api/v1/customers/show.sh +0 -9
  208. data/examples/test-app/docs/api/curl/api/v1/tasks/complete.sh +0 -8
  209. data/examples/test-app/docs/api/curl/api/v1/tasks/create.sh +0 -15
  210. data/examples/test-app/docs/api/curl/api/v1/tasks/destroy.sh +0 -8
  211. data/examples/test-app/docs/api/curl/api/v1/tasks/list.sh +0 -8
  212. data/examples/test-app/docs/api/curl/api/v1/tasks/show.sh +0 -8
  213. data/examples/test-app/docs/api/curl/api/v1/tasks/update.sh +0 -14
  214. data/examples/test-app/docs/api/curl/api/v1/users/create.sh +0 -17
  215. data/examples/test-app/docs/api/curl/api/v1/users/list.sh +0 -9
  216. data/examples/test-app/docs/api/curl/api/v1/users/show.sh +0 -9
  217. data/examples/test-app/docs/api/dataset.json +0 -2402
  218. data/examples/test-app/docs/api/postman/collection.json +0 -1290
  219. data/examples/test-app/generate.rb +0 -14
  220. data/examples/test-app/reqcord.yml +0 -28
  221. data/examples/test-app/test/integration/customers_test.rb +0 -72
  222. data/examples/test-app/test/integration/tasks_test.rb +0 -80
  223. data/examples/test-app/test/integration/users_test.rb +0 -72
@@ -1,61 +0,0 @@
1
- # List Notes
2
-
3
- `GET /api/v1/orders/:order_id/notes`
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
- | `order_id` | string | yes | `"1"` |
19
-
20
- ## cURL
21
-
22
- ```bash
23
- curl --request GET \
24
- --url "http://localhost:3000/api/v1/orders/1/notes" \
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 | `2` |
38
- | `[].order_id` | integer | yes | `1` |
39
- | `[].body` | string | yes | `"Gift wrap please"` |
40
- | `[].author` | string | yes | `"ada"` |
41
-
42
- ```json
43
- [
44
- {
45
- "id": 1,
46
- "order_id": 1,
47
- "body": "Leave at the door",
48
- "author": "ada"
49
- },
50
- {
51
- "id": 2,
52
- "order_id": 1,
53
- "body": "Gift wrap please",
54
- "author": "ada"
55
- }
56
- ]
57
- ```
58
-
59
- ---
60
-
61
- Resource: [Notes](index.md)
@@ -1,69 +0,0 @@
1
- # Cancel Order
2
-
3
- `POST /api/v1/orders/:id/cancel`
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 POST \
24
- --url "http://localhost:3000/api/v1/orders/1/cancel" \
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
- | `user_id` | integer | yes | `1` |
39
- | `status` | string | yes | `"cancelled"` |
40
- | `currency` | string | yes | `"USD"` |
41
- | `total_cents` | integer | yes | `2700` |
42
-
43
- ```json
44
- {
45
- "id": 1,
46
- "user_id": 1,
47
- "status": "cancelled",
48
- "currency": "USD",
49
- "total_cents": 2700
50
- }
51
- ```
52
-
53
- ### 409 Conflict
54
-
55
- #### Fields
56
-
57
- | Field | Type | Required | Values |
58
- | --- | --- | --- | --- |
59
- | `error` | string | yes | `"Shipped orders cannot be cancelled"` |
60
-
61
- ```json
62
- {
63
- "error": "Shipped orders cannot be cancelled"
64
- }
65
- ```
66
-
67
- ---
68
-
69
- Resource: [Orders](index.md)
@@ -1,150 +0,0 @@
1
- # Create Order
2
-
3
- `POST /api/v1/orders`
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
- | `order.line_items[].sku` | string | yes | `"MUG-001"` |
20
- | `order.line_items[].quantity` | integer | yes | `1` |
21
- | `order.shipping_address.line1` | string | yes | `"1 Analytical Engine Way"` |
22
- | `order.shipping_address.city` | string | yes | `"London"` |
23
- | `order.shipping_address.country` | string | yes | `"GB"` \| `"IT"` |
24
-
25
- ## Example Request
26
-
27
- ```json
28
- {
29
- "order": {
30
- "line_items": [
31
- {
32
- "sku": "TEA-001",
33
- "quantity": 2
34
- },
35
- {
36
- "sku": "MUG-001",
37
- "quantity": 1
38
- }
39
- ],
40
- "shipping_address": {
41
- "line1": "1 Analytical Engine Way",
42
- "city": "London",
43
- "country": "GB"
44
- }
45
- }
46
- }
47
- ```
48
-
49
- ## cURL
50
-
51
- ```bash
52
- curl --request POST \
53
- --url "http://localhost:3000/api/v1/orders" \
54
- --header "Authorization: Bearer {{token}}" \
55
- --header "Content-Type: application/json" \
56
- --header "Accept: application/json" \
57
- --data '{
58
- "order": {
59
- "line_items": [
60
- {
61
- "sku": "TEA-001",
62
- "quantity": 2
63
- },
64
- {
65
- "sku": "MUG-001",
66
- "quantity": 1
67
- }
68
- ],
69
- "shipping_address": {
70
- "line1": "1 Analytical Engine Way",
71
- "city": "London",
72
- "country": "GB"
73
- }
74
- }
75
- }'
76
- ```
77
-
78
- ## Responses
79
-
80
- ### 201 Created
81
-
82
- #### Fields
83
-
84
- | Field | Type | Required | Values |
85
- | --- | --- | --- | --- |
86
- | `id` | integer | yes | `4` |
87
- | `status` | string | yes | `"pending"` |
88
- | `currency` | string | yes | `"USD"` |
89
- | `total_cents` | integer | yes | `4800` |
90
- | `line_items[].sku` | string | yes | `"MUG-001"` |
91
- | `line_items[].name` | string | yes | `"Stoneware Mug"` |
92
- | `line_items[].quantity` | integer | yes | `1` |
93
- | `line_items[].unit_price_cents` | integer | yes | `2400` |
94
- | `line_items[].subtotal_cents` | integer | yes | `2400` |
95
- | `shipping_address.line1` | string | yes | `"1 Analytical Engine Way"` |
96
- | `shipping_address.city` | string | yes | `"London"` |
97
- | `shipping_address.country` | string | yes | `"GB"` \| `"IT"` |
98
-
99
- ```json
100
- {
101
- "id": 4,
102
- "status": "pending",
103
- "currency": "USD",
104
- "total_cents": 4800,
105
- "line_items": [
106
- {
107
- "sku": "TEA-001",
108
- "name": "Earl Grey",
109
- "quantity": 2,
110
- "unit_price_cents": 1200,
111
- "subtotal_cents": 2400
112
- },
113
- {
114
- "sku": "MUG-001",
115
- "name": "Stoneware Mug",
116
- "quantity": 1,
117
- "unit_price_cents": 2400,
118
- "subtotal_cents": 2400
119
- }
120
- ],
121
- "shipping_address": {
122
- "line1": "1 Analytical Engine Way",
123
- "city": "London",
124
- "country": "GB"
125
- }
126
- }
127
- ```
128
-
129
- ### 422 Unprocessable Content
130
-
131
- #### Fields
132
-
133
- | Field | Type | Required | Values |
134
- | --- | --- | --- | --- |
135
- | `errors.sku[]` | string | no | `"TEA-999 is not a known product"` |
136
- | `errors.line_items[]` | string | no | `"can't be blank"` |
137
-
138
- ```json
139
- {
140
- "errors": {
141
- "sku": [
142
- "TEA-999 is not a known product"
143
- ]
144
- }
145
- }
146
- ```
147
-
148
- ---
149
-
150
- Resource: [Orders](index.md)
@@ -1,37 +0,0 @@
1
- # Delete Order
2
-
3
- `DELETE /api/v1/orders/: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 DELETE \
24
- --url "http://localhost:3000/api/v1/orders/1" \
25
- --header "Authorization: Bearer {{token}}" \
26
- --header "Accept: application/json"
27
- ```
28
-
29
- ## Responses
30
-
31
- ### 204 No Content
32
-
33
- _No response body._
34
-
35
- ---
36
-
37
- Resource: [Orders](index.md)
@@ -1,13 +0,0 @@
1
- # Orders
2
-
3
- Namespace: `api/v1`
4
-
5
- API version: `v1`
6
-
7
- | Method | Path | Description |
8
- | --- | --- | --- |
9
- | `GET` | [`/api/v1/orders`](list.md) | List Orders |
10
- | `POST` | [`/api/v1/orders`](create.md) | Create Order |
11
- | `DELETE` | [`/api/v1/orders/:id`](destroy.md) | Delete Order |
12
- | `GET` | [`/api/v1/orders/:id`](show.md) | Get Order |
13
- | `POST` | [`/api/v1/orders/:id/cancel`](cancel.md) | Cancel Order |
@@ -1,71 +0,0 @@
1
- # List Orders
2
-
3
- `GET /api/v1/orders`
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
- | `status` | string | no | `"pending"` \| `"shipped"` |
19
-
20
- ## cURL
21
-
22
- ```bash
23
- curl --request GET \
24
- --url "http://localhost:3000/api/v1/orders?status=pending" \
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
- | `[].user_id` | integer | yes | `1` |
39
- | `[].status` | string | yes | `"pending"` \| `"shipped"` |
40
- | `[].currency` | string | yes | `"USD"` |
41
- | `[].total_cents` | integer | yes | `2700` |
42
-
43
- ```json
44
- [
45
- {
46
- "id": 1,
47
- "user_id": 1,
48
- "status": "pending",
49
- "currency": "USD",
50
- "total_cents": 2700
51
- }
52
- ]
53
- ```
54
-
55
- ### 401 Unauthorized
56
-
57
- #### Fields
58
-
59
- | Field | Type | Required | Values |
60
- | --- | --- | --- | --- |
61
- | `error` | string | yes | `"Unauthorized"` |
62
-
63
- ```json
64
- {
65
- "error": "Unauthorized"
66
- }
67
- ```
68
-
69
- ---
70
-
71
- Resource: [Orders](index.md)
@@ -1,83 +0,0 @@
1
- # Get Order
2
-
3
- `GET /api/v1/orders/: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/orders/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
- | `user_id` | integer | yes | `1` |
39
- | `status` | string | yes | `"pending"` |
40
- | `currency` | string | yes | `"USD"` |
41
- | `total_cents` | integer | yes | `2700` |
42
-
43
- ```json
44
- {
45
- "id": 1,
46
- "user_id": 1,
47
- "status": "pending",
48
- "currency": "USD",
49
- "total_cents": 2700
50
- }
51
- ```
52
-
53
- ### 403 Forbidden
54
-
55
- #### Fields
56
-
57
- | Field | Type | Required | Values |
58
- | --- | --- | --- | --- |
59
- | `error` | string | yes | `"Forbidden"` |
60
-
61
- ```json
62
- {
63
- "error": "Forbidden"
64
- }
65
- ```
66
-
67
- ### 404 Not Found
68
-
69
- #### Fields
70
-
71
- | Field | Type | Required | Values |
72
- | --- | --- | --- | --- |
73
- | `error` | string | yes | `"Not Found"` |
74
-
75
- ```json
76
- {
77
- "error": "Not Found"
78
- }
79
- ```
80
-
81
- ---
82
-
83
- Resource: [Orders](index.md)
@@ -1,11 +0,0 @@
1
- # Products
2
-
3
- Namespace: `api/v1`
4
-
5
- API version: `v1`
6
-
7
- | Method | Path | Description |
8
- | --- | --- | --- |
9
- | `GET` | [`/api/v1/products`](list.md) | List Products |
10
- | `GET` | [`/api/v1/products/:id`](show.md) | Get Product |
11
- | `GET` | [`/api/v1/products/search`](search.md) | Search Products |
@@ -1,83 +0,0 @@
1
- # List Products
2
-
3
- `GET /api/v1/products`
4
-
5
- Namespace: `api/v1`
6
-
7
- ## Headers
8
-
9
- | Header | Value |
10
- | --- | --- |
11
- | Accept | `application/json` |
12
-
13
- ## Query Parameters
14
-
15
- | Field | Type | Required | Values |
16
- | --- | --- | --- | --- |
17
- | `filter.category` | string | no | `"mugs"` \| `"tea"` |
18
- | `sort` | string | no | `"price_asc"` \| `"price_desc"` |
19
- | `page` | integer | no | `2` |
20
- | `per_page` | integer | no | `2` |
21
-
22
- ## cURL
23
-
24
- ```bash
25
- curl --request GET \
26
- --url "http://localhost:3000/api/v1/products?filter%5Bcategory%5D=tea" \
27
- --header "Accept: application/json"
28
- ```
29
-
30
- ## Responses
31
-
32
- ### 200 OK
33
-
34
- #### Fields
35
-
36
- | Field | Type | Required | Values |
37
- | --- | --- | --- | --- |
38
- | `data[].id` | integer | yes | `2` |
39
- | `data[].sku` | string | yes | `"TEA-002"` |
40
- | `data[].name` | string | yes | `"Sencha"` |
41
- | `data[].category` | string | yes | `"mugs"` \| `"tea"` |
42
- | `data[].price_cents` | integer | yes | `1500` |
43
- | `data[].tags[]` | string | yes | `"ceramic"` \| `"green"` \| `"insulated"` |
44
- | `meta.page` | integer | yes | `1` |
45
- | `meta.per_page` | integer | yes | `2` |
46
- | `meta.total` | integer | yes | `2` |
47
-
48
- ```json
49
- {
50
- "data": [
51
- {
52
- "id": 1,
53
- "sku": "TEA-001",
54
- "name": "Earl Grey",
55
- "category": "tea",
56
- "price_cents": 1200,
57
- "tags": [
58
- "black",
59
- "bergamot"
60
- ]
61
- },
62
- {
63
- "id": 2,
64
- "sku": "TEA-002",
65
- "name": "Sencha",
66
- "category": "tea",
67
- "price_cents": 1500,
68
- "tags": [
69
- "green"
70
- ]
71
- }
72
- ],
73
- "meta": {
74
- "page": 1,
75
- "per_page": 2,
76
- "total": 2
77
- }
78
- }
79
- ```
80
-
81
- ---
82
-
83
- Resource: [Products](index.md)
@@ -1,88 +0,0 @@
1
- # Search Products
2
-
3
- `GET /api/v1/products/search`
4
-
5
- Namespace: `api/v1`
6
-
7
- ## Headers
8
-
9
- | Header | Value |
10
- | --- | --- |
11
- | Accept | `application/json` |
12
-
13
- ## Query Parameters
14
-
15
- | Field | Type | Required | Values |
16
- | --- | --- | --- | --- |
17
- | `q` | string | yes | `"mug"` |
18
-
19
- ## cURL
20
-
21
- ```bash
22
- curl --request GET \
23
- --url "http://localhost:3000/api/v1/products/search?q=mug" \
24
- --header "Accept: application/json"
25
- ```
26
-
27
- ## Responses
28
-
29
- ### 200 OK
30
-
31
- #### Fields
32
-
33
- | Field | Type | Required | Values |
34
- | --- | --- | --- | --- |
35
- | `query` | string | yes | `"mug"` |
36
- | `results[].id` | integer | yes | `4` |
37
- | `results[].sku` | string | yes | `"MUG-002"` |
38
- | `results[].name` | string | yes | `"Travel Mug"` |
39
- | `results[].category` | string | yes | `"mugs"` |
40
- | `results[].price_cents` | integer | yes | `3200` |
41
- | `results[].tags[]` | string | yes | `"insulated"` |
42
-
43
- ```json
44
- {
45
- "query": "mug",
46
- "results": [
47
- {
48
- "id": 3,
49
- "sku": "MUG-001",
50
- "name": "Stoneware Mug",
51
- "category": "mugs",
52
- "price_cents": 2400,
53
- "tags": [
54
- "ceramic"
55
- ]
56
- },
57
- {
58
- "id": 4,
59
- "sku": "MUG-002",
60
- "name": "Travel Mug",
61
- "category": "mugs",
62
- "price_cents": 3200,
63
- "tags": [
64
- "steel",
65
- "insulated"
66
- ]
67
- }
68
- ]
69
- }
70
- ```
71
-
72
- ### 400 Bad Request
73
-
74
- #### Fields
75
-
76
- | Field | Type | Required | Values |
77
- | --- | --- | --- | --- |
78
- | `error` | string | yes | `"q is required"` |
79
-
80
- ```json
81
- {
82
- "error": "q is required"
83
- }
84
- ```
85
-
86
- ---
87
-
88
- Resource: [Products](index.md)