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
data/Gemfile.lock DELETED
@@ -1,171 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- reqcord (0.1.1)
5
- actionpack (>= 8.0, < 9.0)
6
- railties (>= 8.0, < 9.0)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- actionpack (8.1.3.1)
12
- actionview (= 8.1.3.1)
13
- activesupport (= 8.1.3.1)
14
- nokogiri (>= 1.8.5)
15
- rack (>= 2.2.4)
16
- rack-session (>= 1.0.1)
17
- rack-test (>= 0.6.3)
18
- rails-dom-testing (~> 2.2)
19
- rails-html-sanitizer (~> 1.6)
20
- useragent (~> 0.16)
21
- actionview (8.1.3.1)
22
- activesupport (= 8.1.3.1)
23
- builder (~> 3.1)
24
- erubi (~> 1.11)
25
- rails-dom-testing (~> 2.2)
26
- rails-html-sanitizer (~> 1.6)
27
- activesupport (8.1.3.1)
28
- base64
29
- bigdecimal
30
- concurrent-ruby (~> 1.0, >= 1.3.1)
31
- connection_pool (>= 2.2.5)
32
- drb
33
- i18n (>= 1.6, < 2)
34
- json
35
- logger (>= 1.4.2)
36
- minitest (>= 5.1)
37
- securerandom (>= 0.3)
38
- tzinfo (~> 2.0, >= 2.0.5)
39
- uri (>= 0.13.1)
40
- base64 (0.3.0)
41
- bigdecimal (4.1.2)
42
- builder (3.3.0)
43
- concurrent-ruby (1.3.8)
44
- connection_pool (3.0.2)
45
- crass (1.0.7)
46
- drb (2.2.3)
47
- erb (6.0.7)
48
- erubi (1.13.1)
49
- i18n (1.15.2)
50
- concurrent-ruby (~> 1.0)
51
- io-console (0.9.2)
52
- irb (1.18.0)
53
- pp (>= 0.6.0)
54
- prism (>= 1.3.0)
55
- rdoc (>= 4.0.0)
56
- reline (>= 0.4.2)
57
- json (2.21.2)
58
- logger (1.7.0)
59
- loofah (2.25.2)
60
- crass (~> 1.0.2)
61
- nokogiri (>= 1.12.0)
62
- minitest (6.0.6)
63
- drb (~> 2.0)
64
- prism (~> 1.5)
65
- nokogiri (1.19.4-arm64-darwin)
66
- racc (~> 1.4)
67
- pp (0.6.4)
68
- prettyprint
69
- prettyprint (0.2.0)
70
- prism (1.9.0)
71
- racc (1.8.1)
72
- rack (3.2.7)
73
- rack-session (2.1.2)
74
- base64 (>= 0.1.0)
75
- rack (>= 3.0.0)
76
- rack-test (2.2.0)
77
- rack (>= 1.3)
78
- rackup (2.3.1)
79
- rack (>= 3)
80
- rails-dom-testing (2.3.0)
81
- activesupport (>= 5.0.0)
82
- minitest
83
- nokogiri (>= 1.6)
84
- rails-html-sanitizer (1.7.1)
85
- loofah (~> 2.25, >= 2.25.2)
86
- nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
87
- railties (8.1.3.1)
88
- actionpack (= 8.1.3.1)
89
- activesupport (= 8.1.3.1)
90
- irb (~> 1.13)
91
- rackup (>= 1.0.0)
92
- rake (>= 12.2)
93
- thor (~> 1.0, >= 1.2.2)
94
- tsort (>= 0.2)
95
- zeitwerk (~> 2.6)
96
- rake (13.4.2)
97
- rbs (4.2.0)
98
- logger
99
- prism (>= 1.6.0)
100
- tsort
101
- rdoc (8.0.0)
102
- erb
103
- prism (>= 1.6.0)
104
- rbs (>= 4.0.0)
105
- tsort
106
- reline (0.7.0)
107
- io-console (~> 0.5)
108
- securerandom (0.4.1)
109
- thor (1.5.0)
110
- tsort (0.2.0)
111
- tzinfo (2.0.6)
112
- concurrent-ruby (~> 1.0)
113
- uri (1.1.1)
114
- useragent (0.16.11)
115
- zeitwerk (2.8.3)
116
-
117
- PLATFORMS
118
- arm64-darwin-24
119
-
120
- DEPENDENCIES
121
- minitest
122
- rake
123
- reqcord!
124
-
125
- CHECKSUMS
126
- actionpack (8.1.3.1)
127
- actionview (8.1.3.1)
128
- activesupport (8.1.3.1)
129
- base64 (0.3.0)
130
- bigdecimal (4.1.2)
131
- builder (3.3.0)
132
- concurrent-ruby (1.3.8)
133
- connection_pool (3.0.2)
134
- crass (1.0.7)
135
- drb (2.2.3)
136
- erb (6.0.7)
137
- erubi (1.13.1)
138
- i18n (1.15.2)
139
- io-console (0.9.2)
140
- irb (1.18.0)
141
- json (2.21.2)
142
- logger (1.7.0)
143
- loofah (2.25.2)
144
- minitest (6.0.6)
145
- nokogiri (1.19.4-arm64-darwin)
146
- pp (0.6.4)
147
- prettyprint (0.2.0)
148
- prism (1.9.0)
149
- racc (1.8.1)
150
- rack (3.2.7)
151
- rack-session (2.1.2)
152
- rack-test (2.2.0)
153
- rackup (2.3.1)
154
- rails-dom-testing (2.3.0)
155
- rails-html-sanitizer (1.7.1)
156
- railties (8.1.3.1)
157
- rake (13.4.2)
158
- rbs (4.2.0)
159
- rdoc (8.0.0)
160
- reline (0.7.0)
161
- reqcord (0.1.1)
162
- securerandom (0.4.1)
163
- thor (1.5.0)
164
- tsort (0.2.0)
165
- tzinfo (2.0.6)
166
- uri (1.1.1)
167
- useragent (0.16.11)
168
- zeitwerk (2.8.3)
169
-
170
- BUNDLED WITH
171
- 4.0.3
@@ -1 +0,0 @@
1
- --require spec_helper
@@ -1,21 +0,0 @@
1
- # complex-spec-app (RSpec)
2
-
3
- The store API of [complex-test-app](../complex-test-app), documented from
4
- RSpec request specs instead of Minitest. The application file is identical;
5
- only the specs differ, and the generated dataset lists the same 22 endpoints.
6
-
7
- ```text
8
- app.rb the application (same as complex-test-app)
9
- spec/requests/*_spec.rb ordinary request specs
10
- spec/spec_helper.rb request helpers for plain rspec-core (see spec-app)
11
- reqcord.yml `test.framework: rspec`, `paths: [spec/requests]`
12
- docs/api/ generated Markdown, cURL scripts, Postman collection
13
- ```
14
-
15
- ## Regenerate
16
-
17
- ```bash
18
- ruby generate.rb
19
- ```
20
-
21
- See the endpoint tour in the [complex-test-app README](../complex-test-app/README.md).
@@ -1,363 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # The store API of complex-test-app, byte for byte, documented from RSpec
4
- # request specs instead of Minitest. See ../complex-test-app/app.rb for the
5
- # tour of what each endpoint shows.
6
- ENV["RAILS_ENV"] ||= "test"
7
-
8
- # Only needed because this example lives inside the Reqcord repository.
9
- # In your own application, `gem "reqcord"` in the Gemfile is enough.
10
- $LOAD_PATH.unshift File.expand_path("../../lib", __dir__)
11
-
12
- require "rails"
13
- require "action_controller/railtie"
14
- require "reqcord"
15
-
16
- class ComplexApp < Rails::Application
17
- config.root = __dir__
18
- config.eager_load = false
19
- config.logger = Logger.new(IO::NULL)
20
- config.secret_key_base = "a" * 64
21
- config.hosts.clear
22
- end
23
-
24
- Rails.application.initialize!
25
-
26
- module Store
27
- PRODUCTS = [
28
- { id: 1, sku: "TEA-001", name: "Earl Grey", category: "tea", price_cents: 1200, cost_cents: 500, tags: %w[black bergamot] },
29
- { id: 2, sku: "TEA-002", name: "Sencha", category: "tea", price_cents: 1500, cost_cents: 700, tags: %w[green] },
30
- { id: 3, sku: "MUG-001", name: "Stoneware Mug", category: "mugs", price_cents: 2400, cost_cents: 900, tags: %w[ceramic] },
31
- { id: 4, sku: "MUG-002", name: "Travel Mug", category: "mugs", price_cents: 3200, cost_cents: 1400, tags: %w[steel insulated] }
32
- ].freeze
33
-
34
- PUBLIC_PRODUCT = %i[id sku name category price_cents tags].freeze
35
-
36
- ORDERS = [
37
- { id: 1, user_id: 1, status: "pending", currency: "USD", total_cents: 2700 },
38
- { id: 2, user_id: 1, status: "shipped", currency: "USD", total_cents: 3200 },
39
- { id: 3, user_id: 2, status: "pending", currency: "EUR", total_cents: 1500 }
40
- ].freeze
41
-
42
- NOTES = [
43
- { id: 1, order_id: 1, body: "Leave at the door", author: "ada" },
44
- { id: 2, order_id: 1, body: "Gift wrap please", author: "ada" }
45
- ].freeze
46
-
47
- PROFILE = { id: 1, name: "Ada Lovelace", email: "ada@example.com", locale: "en" }.freeze
48
- LOCALES = %w[en tr].freeze
49
-
50
- CART_ITEMS = [
51
- { sku: "TEA-001", name: "Earl Grey", quantity: 2, unit_price_cents: 1200 },
52
- { sku: "MUG-001", name: "Stoneware Mug", quantity: 1, unit_price_cents: 2400 }
53
- ].freeze
54
- PAYMENT_METHODS = %w[card bank_transfer].freeze
55
- end
56
-
57
- module Api
58
- module V1
59
- class BaseController < ActionController::API
60
- private
61
-
62
- def authenticate!
63
- return if request.headers["Authorization"].present?
64
-
65
- render json: { error: "Unauthorized" }, status: :unauthorized
66
- end
67
-
68
- def not_found
69
- render json: { error: "Not Found" }, status: :not_found
70
- end
71
- end
72
-
73
- class HomeController < BaseController
74
- def index
75
- render json: { name: "Store API", version: "v1", links: { products: "/api/v1/products", orders: "/api/v1/orders" } }
76
- end
77
- end
78
-
79
- class AuthController < BaseController
80
- def login
81
- if params[:email] == "ada@example.com" && params[:password] == "correct-horse-battery"
82
- render json: { token: "tok_live_9f8e7d6c", token_type: "Bearer", expires_in: 3600 }
83
- else
84
- render json: { error: "Invalid email or password" }, status: :unauthorized
85
- end
86
- end
87
- end
88
-
89
- class ProfilesController < BaseController
90
- before_action :authenticate!
91
-
92
- def show
93
- render json: Store::PROFILE
94
- end
95
-
96
- def update
97
- attributes = params.require(:profile).permit(:name, :locale).to_h.symbolize_keys
98
-
99
- if attributes.key?(:locale) && !Store::LOCALES.include?(attributes[:locale])
100
- return render(json: { errors: { locale: ["is not included in the list"] } }, status: :unprocessable_entity)
101
- end
102
-
103
- render json: Store::PROFILE.merge(attributes)
104
- end
105
- end
106
-
107
- class ProductsController < BaseController
108
- def index
109
- products = Store::PRODUCTS
110
- category = params.dig(:filter, :category)
111
- products = products.select { |product| product[:category] == category } if category.present?
112
- products = products.sort_by { |product| product[:price_cents] } if params[:sort] == "price_asc"
113
- products = products.sort_by { |product| -product[:price_cents] } if params[:sort] == "price_desc"
114
-
115
- page = params.fetch(:page, 1).to_i
116
- per_page = params.fetch(:per_page, 2).to_i
117
- slice = products.each_slice(per_page).to_a[page - 1] || []
118
-
119
- render json: {
120
- data: slice.map { |product| product.slice(*Store::PUBLIC_PRODUCT) },
121
- meta: { page: page, per_page: per_page, total: products.size }
122
- }
123
- end
124
-
125
- def show
126
- product = Store::PRODUCTS.find { |candidate| candidate[:id] == params[:id].to_i }
127
-
128
- return not_found unless product
129
-
130
- render json: product.slice(*Store::PUBLIC_PRODUCT)
131
- end
132
-
133
- def search
134
- query = params[:q].to_s.strip
135
-
136
- return render(json: { error: "q is required" }, status: :bad_request) if query.empty?
137
-
138
- matches = Store::PRODUCTS.select { |product| product[:name].downcase.include?(query.downcase) }
139
-
140
- render json: { query: query, results: matches.map { |product| product.slice(*Store::PUBLIC_PRODUCT) } }
141
- end
142
- end
143
-
144
- class OrdersController < BaseController
145
- before_action :authenticate!
146
- before_action :find_order, only: %i[show cancel destroy]
147
-
148
- def index
149
- orders = Store::ORDERS.select { |order| order[:user_id] == 1 }
150
- orders = orders.select { |order| order[:status] == params[:status] } if params[:status].present?
151
-
152
- render json: orders
153
- end
154
-
155
- def show
156
- return render(json: { error: "Forbidden" }, status: :forbidden) unless @order[:user_id] == 1
157
-
158
- render json: @order
159
- end
160
-
161
- def create
162
- attributes = params.require(:order)
163
- .permit(line_items: %i[sku quantity], shipping_address: %i[line1 city country])
164
- .to_h.deep_symbolize_keys
165
- items = Array(attributes[:line_items])
166
-
167
- return render(json: { errors: { line_items: ["can't be blank"] } }, status: :unprocessable_entity) if items.empty?
168
-
169
- lines = items.map do |item|
170
- product = Store::PRODUCTS.find { |candidate| candidate[:sku] == item[:sku] }
171
-
172
- return render(json: { errors: { sku: ["#{item[:sku]} is not a known product"] } }, status: :unprocessable_entity) unless product
173
-
174
- quantity = item[:quantity].to_i
175
- {
176
- sku: product[:sku], name: product[:name], quantity: quantity,
177
- unit_price_cents: product[:price_cents], subtotal_cents: product[:price_cents] * quantity
178
- }
179
- end
180
-
181
- render json: {
182
- id: 4, status: "pending", currency: "USD",
183
- total_cents: lines.sum { |line| line[:subtotal_cents] },
184
- line_items: lines,
185
- shipping_address: attributes[:shipping_address]
186
- }, status: :created
187
- end
188
-
189
- def cancel
190
- if @order[:status] == "shipped"
191
- return render(json: { error: "Shipped orders cannot be cancelled" }, status: :conflict)
192
- end
193
-
194
- render json: @order.merge(status: "cancelled")
195
- end
196
-
197
- def destroy
198
- head :no_content
199
- end
200
-
201
- private
202
-
203
- def find_order
204
- @order = Store::ORDERS.find { |order| order[:id] == params[:id].to_i }
205
-
206
- not_found unless @order
207
- end
208
- end
209
-
210
- class NotesController < BaseController
211
- before_action :authenticate!
212
- before_action :find_order
213
-
214
- def index
215
- render json: Store::NOTES.select { |note| note[:order_id] == @order[:id] }
216
- end
217
-
218
- def create
219
- body = params.dig(:note, :body).to_s
220
-
221
- return render(json: { errors: { body: ["can't be blank"] } }, status: :unprocessable_entity) if body.empty?
222
-
223
- render json: { id: 3, order_id: @order[:id], body: body, author: "ada" }, status: :created
224
- end
225
-
226
- private
227
-
228
- def find_order
229
- @order = Store::ORDERS.find { |order| order[:id] == params[:order_id].to_i }
230
-
231
- not_found unless @order
232
- end
233
- end
234
-
235
- class CartsController < BaseController
236
- before_action :authenticate!
237
-
238
- def show
239
- render json: cart
240
- end
241
-
242
- def checkout
243
- method = params[:payment_method].to_s
244
-
245
- unless Store::PAYMENT_METHODS.include?(method)
246
- return render(json: { errors: { payment_method: ["is not included in the list"] } }, status: :unprocessable_entity)
247
- end
248
-
249
- render json: { id: 5, status: "pending", payment_method: method, total_cents: cart[:total_cents], line_items: cart[:items] },
250
- status: :created
251
- end
252
-
253
- private
254
-
255
- def cart
256
- { items: Store::CART_ITEMS, total_cents: Store::CART_ITEMS.sum { |item| item[:quantity] * item[:unit_price_cents] } }
257
- end
258
- end
259
-
260
- class CartItemsController < BaseController
261
- before_action :authenticate!
262
-
263
- def create
264
- attributes = params.require(:item).permit(:sku, :quantity).to_h.symbolize_keys
265
- product = Store::PRODUCTS.find { |candidate| candidate[:sku] == attributes[:sku] }
266
-
267
- return render(json: { errors: { sku: ["#{attributes[:sku]} is not a known product"] } }, status: :unprocessable_entity) unless product
268
-
269
- render json: { sku: product[:sku], name: product[:name], quantity: attributes[:quantity].to_i, unit_price_cents: product[:price_cents] },
270
- status: :created
271
- end
272
-
273
- def destroy
274
- return not_found unless Store::CART_ITEMS.any? { |item| item[:sku] == params[:sku] }
275
-
276
- head :no_content
277
- end
278
- end
279
-
280
- module Admin
281
- class ProductsController < BaseController
282
- before_action :require_api_key
283
-
284
- def index
285
- render json: Store::PRODUCTS
286
- end
287
-
288
- def create
289
- attributes = params.require(:product).permit(:sku, :name, :category, :price_cents).to_h.symbolize_keys
290
-
291
- if attributes[:sku].to_s.empty? || attributes[:name].to_s.empty?
292
- return render(json: { errors: { sku: ["can't be blank"] } }, status: :unprocessable_entity)
293
- end
294
-
295
- if Store::PRODUCTS.any? { |product| product[:sku] == attributes[:sku] }
296
- return render(json: { error: "sku #{attributes[:sku]} already exists" }, status: :conflict)
297
- end
298
-
299
- render json: { id: 5, cost_cents: 0, tags: [], **attributes }, status: :created
300
- end
301
-
302
- def destroy
303
- return not_found unless Store::PRODUCTS.any? { |product| product[:id] == params[:id].to_i }
304
-
305
- head :no_content
306
- end
307
-
308
- private
309
-
310
- def require_api_key
311
- return if request.headers["X-Api-Key"].present?
312
-
313
- render json: { error: "API key required" }, status: :unauthorized
314
- end
315
- end
316
- end
317
- end
318
-
319
- module V2
320
- class ProductsController < ActionController::API
321
- def index
322
- start = params[:cursor].present? ? 2 : 0
323
- items = Store::PRODUCTS[start, 2].map { |product| product.slice(*Store::PUBLIC_PRODUCT).merge(price: format("%.2f", product[:price_cents] / 100.0)) }
324
-
325
- render json: { items: items, next_cursor: start.zero? ? "eyJpZCI6Mn0" : nil }
326
- end
327
- end
328
- end
329
- end
330
-
331
- Rails.application.routes.draw do
332
- namespace :api do
333
- namespace :v1 do
334
- root to: "home#index"
335
-
336
- post "auth/login", to: "auth#login"
337
-
338
- resource :profile, only: %i[show update]
339
-
340
- resources :products, only: %i[index show] do
341
- get :search, on: :collection
342
- end
343
-
344
- resources :orders, only: %i[index show create destroy] do
345
- post :cancel, on: :member
346
- resources :notes, only: %i[index create]
347
- end
348
-
349
- resource :cart, only: :show do
350
- post :checkout
351
- resources :items, only: %i[create destroy], controller: "cart_items", param: :sku
352
- end
353
-
354
- namespace :admin do
355
- resources :products, only: %i[index create destroy]
356
- end
357
- end
358
-
359
- namespace :v2 do
360
- resources :products, only: :index
361
- end
362
- end
363
- end
@@ -1,104 +0,0 @@
1
- # API Documentation
2
-
3
- Generated by Reqcord from the application's integration tests.
4
-
5
- Base URL: `http://localhost:3000`
6
-
7
- ## Placeholders
8
-
9
- | Header | Replace with |
10
- | --- | --- |
11
- | Authorization | `Bearer {{token}}` |
12
- | X-Api-Key | `{{api_key}}` |
13
-
14
- ## Products
15
-
16
- Namespace: `api/v1/admin`
17
-
18
- | Method | Path | Description |
19
- | --- | --- | --- |
20
- | `GET` | [`/api/v1/admin/products`](api/v1/admin/products/list.md) | List Products |
21
- | `POST` | [`/api/v1/admin/products`](api/v1/admin/products/create.md) | Create Product |
22
- | `DELETE` | [`/api/v1/admin/products/:id`](api/v1/admin/products/destroy.md) | Delete Product |
23
-
24
- ## Auth
25
-
26
- Namespace: `api/v1`
27
-
28
- | Method | Path | Description |
29
- | --- | --- | --- |
30
- | `POST` | [`/api/v1/auth/login`](api/v1/auth/login.md) | Login |
31
-
32
- ## Cart Items
33
-
34
- Namespace: `api/v1`
35
-
36
- | Method | Path | Description |
37
- | --- | --- | --- |
38
- | `POST` | [`/api/v1/cart/items`](api/v1/cart-items/create.md) | Create Cart Item |
39
- | `DELETE` | [`/api/v1/cart/items/:sku`](api/v1/cart-items/destroy.md) | Delete Cart Item |
40
-
41
- ## Carts
42
-
43
- Namespace: `api/v1`
44
-
45
- | Method | Path | Description |
46
- | --- | --- | --- |
47
- | `GET` | [`/api/v1/cart`](api/v1/carts/show.md) | Get Cart |
48
- | `POST` | [`/api/v1/cart/checkout`](api/v1/carts/checkout.md) | Checkout Cart |
49
-
50
- ## Home
51
-
52
- Namespace: `api/v1`
53
-
54
- | Method | Path | Description |
55
- | --- | --- | --- |
56
- | `GET` | [`/api/v1`](api/v1/home/list.md) | Home |
57
-
58
- ## Notes
59
-
60
- Namespace: `api/v1`
61
-
62
- | Method | Path | Description |
63
- | --- | --- | --- |
64
- | `GET` | [`/api/v1/orders/:order_id/notes`](api/v1/notes/list.md) | List Notes |
65
- | `POST` | [`/api/v1/orders/:order_id/notes`](api/v1/notes/create.md) | Create Note |
66
-
67
- ## Orders
68
-
69
- Namespace: `api/v1`
70
-
71
- | Method | Path | Description |
72
- | --- | --- | --- |
73
- | `GET` | [`/api/v1/orders`](api/v1/orders/list.md) | List Orders |
74
- | `POST` | [`/api/v1/orders`](api/v1/orders/create.md) | Create Order |
75
- | `DELETE` | [`/api/v1/orders/:id`](api/v1/orders/destroy.md) | Delete Order |
76
- | `GET` | [`/api/v1/orders/:id`](api/v1/orders/show.md) | Get Order |
77
- | `POST` | [`/api/v1/orders/:id/cancel`](api/v1/orders/cancel.md) | Cancel Order |
78
-
79
- ## Products
80
-
81
- Namespace: `api/v1`
82
-
83
- | Method | Path | Description |
84
- | --- | --- | --- |
85
- | `GET` | [`/api/v1/products`](api/v1/products/list.md) | List Products |
86
- | `GET` | [`/api/v1/products/:id`](api/v1/products/show.md) | Get Product |
87
- | `GET` | [`/api/v1/products/search`](api/v1/products/search.md) | Search Products |
88
-
89
- ## Profiles
90
-
91
- Namespace: `api/v1`
92
-
93
- | Method | Path | Description |
94
- | --- | --- | --- |
95
- | `GET` | [`/api/v1/profile`](api/v1/profiles/show.md) | Get Profile |
96
- | `PATCH` | [`/api/v1/profile`](api/v1/profiles/update.md) | Update Profile |
97
-
98
- ## Products
99
-
100
- Namespace: `api/v2`
101
-
102
- | Method | Path | Description |
103
- | --- | --- | --- |
104
- | `GET` | [`/api/v2/products`](api/v2/products/list.md) | List Products |