reqcord 0.1.0 → 0.1.1

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 (249) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +8 -0
  3. data/CHANGELOG.md +77 -0
  4. data/Gemfile +5 -0
  5. data/Gemfile.lock +171 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +239 -95
  8. data/Rakefile +13 -0
  9. data/docs/configuration.md +319 -0
  10. data/examples/complex-spec-app/.rspec +1 -0
  11. data/examples/complex-spec-app/README.md +21 -0
  12. data/examples/complex-spec-app/app.rb +363 -0
  13. data/examples/complex-spec-app/docs/api/README.md +104 -0
  14. data/examples/complex-spec-app/docs/api/api/v1/admin/products/create.md +117 -0
  15. data/examples/complex-spec-app/docs/api/api/v1/admin/products/destroy.md +51 -0
  16. data/examples/complex-spec-app/docs/api/api/v1/admin/products/index.md +11 -0
  17. data/examples/complex-spec-app/docs/api/api/v1/admin/products/list.md +106 -0
  18. data/examples/complex-spec-app/docs/api/api/v1/auth/index.md +9 -0
  19. data/examples/complex-spec-app/docs/api/api/v1/auth/login.md +76 -0
  20. data/examples/complex-spec-app/docs/api/api/v1/cart-items/create.md +91 -0
  21. data/examples/complex-spec-app/docs/api/api/v1/cart-items/destroy.md +51 -0
  22. data/examples/complex-spec-app/docs/api/api/v1/cart-items/index.md +10 -0
  23. data/examples/complex-spec-app/docs/api/api/v1/carts/checkout.md +102 -0
  24. data/examples/complex-spec-app/docs/api/api/v1/carts/index.md +10 -0
  25. data/examples/complex-spec-app/docs/api/api/v1/carts/show.md +73 -0
  26. data/examples/complex-spec-app/docs/api/api/v1/home/index.md +9 -0
  27. data/examples/complex-spec-app/docs/api/api/v1/home/list.md +47 -0
  28. data/examples/complex-spec-app/docs/api/api/v1/notes/create.md +94 -0
  29. data/examples/complex-spec-app/docs/api/api/v1/notes/index.md +10 -0
  30. data/examples/complex-spec-app/docs/api/api/v1/notes/list.md +61 -0
  31. data/examples/complex-spec-app/docs/api/api/v1/orders/cancel.md +69 -0
  32. data/examples/complex-spec-app/docs/api/api/v1/orders/create.md +150 -0
  33. data/examples/complex-spec-app/docs/api/api/v1/orders/destroy.md +37 -0
  34. data/examples/complex-spec-app/docs/api/api/v1/orders/index.md +13 -0
  35. data/examples/complex-spec-app/docs/api/api/v1/orders/list.md +78 -0
  36. data/examples/complex-spec-app/docs/api/api/v1/orders/show.md +83 -0
  37. data/examples/complex-spec-app/docs/api/api/v1/products/index.md +11 -0
  38. data/examples/complex-spec-app/docs/api/api/v1/products/list.md +83 -0
  39. data/examples/complex-spec-app/docs/api/api/v1/products/search.md +88 -0
  40. data/examples/complex-spec-app/docs/api/api/v1/products/show.md +71 -0
  41. data/examples/complex-spec-app/docs/api/api/v1/profiles/index.md +10 -0
  42. data/examples/complex-spec-app/docs/api/api/v1/profiles/show.md +61 -0
  43. data/examples/complex-spec-app/docs/api/api/v1/profiles/update.md +91 -0
  44. data/examples/complex-spec-app/docs/api/api/v2/products/index.md +9 -0
  45. data/examples/complex-spec-app/docs/api/api/v2/products/list.md +77 -0
  46. data/examples/complex-spec-app/docs/api/curl/api/v1/admin/products/create.sh +18 -0
  47. data/examples/complex-spec-app/docs/api/curl/api/v1/admin/products/destroy.sh +9 -0
  48. data/examples/complex-spec-app/docs/api/curl/api/v1/admin/products/list.sh +9 -0
  49. data/examples/complex-spec-app/docs/api/curl/api/v1/auth/login.sh +9 -0
  50. data/examples/complex-spec-app/docs/api/curl/api/v1/cart-items/create.sh +16 -0
  51. data/examples/complex-spec-app/docs/api/curl/api/v1/cart-items/destroy.sh +9 -0
  52. data/examples/complex-spec-app/docs/api/curl/api/v1/carts/checkout.sh +13 -0
  53. data/examples/complex-spec-app/docs/api/curl/api/v1/carts/show.sh +9 -0
  54. data/examples/complex-spec-app/docs/api/curl/api/v1/home/list.sh +8 -0
  55. data/examples/complex-spec-app/docs/api/curl/api/v1/notes/create.sh +15 -0
  56. data/examples/complex-spec-app/docs/api/curl/api/v1/notes/list.sh +9 -0
  57. data/examples/complex-spec-app/docs/api/curl/api/v1/orders/cancel.sh +9 -0
  58. data/examples/complex-spec-app/docs/api/curl/api/v1/orders/create.sh +29 -0
  59. data/examples/complex-spec-app/docs/api/curl/api/v1/orders/destroy.sh +9 -0
  60. data/examples/complex-spec-app/docs/api/curl/api/v1/orders/list.sh +9 -0
  61. data/examples/complex-spec-app/docs/api/curl/api/v1/orders/show.sh +9 -0
  62. data/examples/complex-spec-app/docs/api/curl/api/v1/products/list.sh +8 -0
  63. data/examples/complex-spec-app/docs/api/curl/api/v1/products/search.sh +8 -0
  64. data/examples/complex-spec-app/docs/api/curl/api/v1/products/show.sh +8 -0
  65. data/examples/complex-spec-app/docs/api/curl/api/v1/profiles/show.sh +9 -0
  66. data/examples/complex-spec-app/docs/api/curl/api/v1/profiles/update.sh +16 -0
  67. data/examples/complex-spec-app/docs/api/curl/api/v2/products/list.sh +8 -0
  68. data/examples/complex-spec-app/docs/api/dataset.json +5116 -0
  69. data/examples/complex-spec-app/docs/api/postman/collection.json +2519 -0
  70. data/examples/complex-spec-app/generate.rb +14 -0
  71. data/examples/complex-spec-app/reqcord.yml +28 -0
  72. data/examples/complex-spec-app/spec/requests/admin_spec.rb +67 -0
  73. data/examples/complex-spec-app/spec/requests/cart_spec.rb +61 -0
  74. data/examples/complex-spec-app/spec/requests/home_and_auth_spec.rb +49 -0
  75. data/examples/complex-spec-app/spec/requests/orders_spec.rb +124 -0
  76. data/examples/complex-spec-app/spec/requests/products_spec.rb +65 -0
  77. data/examples/complex-spec-app/spec/spec_helper.rb +17 -0
  78. data/examples/complex-test-app/README.md +40 -0
  79. data/examples/complex-test-app/app.rb +384 -0
  80. data/examples/complex-test-app/docs/api/README.md +104 -0
  81. data/examples/complex-test-app/docs/api/api/v1/admin/products/create.md +117 -0
  82. data/examples/complex-test-app/docs/api/api/v1/admin/products/destroy.md +51 -0
  83. data/examples/complex-test-app/docs/api/api/v1/admin/products/index.md +11 -0
  84. data/examples/complex-test-app/docs/api/api/v1/admin/products/list.md +106 -0
  85. data/examples/complex-test-app/docs/api/api/v1/auth/index.md +9 -0
  86. data/examples/complex-test-app/docs/api/api/v1/auth/login.md +76 -0
  87. data/examples/complex-test-app/docs/api/api/v1/cart-items/create.md +91 -0
  88. data/examples/complex-test-app/docs/api/api/v1/cart-items/destroy.md +51 -0
  89. data/examples/complex-test-app/docs/api/api/v1/cart-items/index.md +10 -0
  90. data/examples/complex-test-app/docs/api/api/v1/carts/checkout.md +102 -0
  91. data/examples/complex-test-app/docs/api/api/v1/carts/index.md +10 -0
  92. data/examples/complex-test-app/docs/api/api/v1/carts/show.md +73 -0
  93. data/examples/complex-test-app/docs/api/api/v1/home/index.md +9 -0
  94. data/examples/complex-test-app/docs/api/api/v1/home/list.md +47 -0
  95. data/examples/complex-test-app/docs/api/api/v1/notes/create.md +94 -0
  96. data/examples/complex-test-app/docs/api/api/v1/notes/index.md +10 -0
  97. data/examples/complex-test-app/docs/api/api/v1/notes/list.md +61 -0
  98. data/examples/complex-test-app/docs/api/api/v1/orders/cancel.md +69 -0
  99. data/examples/complex-test-app/docs/api/api/v1/orders/create.md +150 -0
  100. data/examples/complex-test-app/docs/api/api/v1/orders/destroy.md +37 -0
  101. data/examples/complex-test-app/docs/api/api/v1/orders/index.md +13 -0
  102. data/examples/complex-test-app/docs/api/api/v1/orders/list.md +71 -0
  103. data/examples/complex-test-app/docs/api/api/v1/orders/show.md +83 -0
  104. data/examples/complex-test-app/docs/api/api/v1/products/index.md +11 -0
  105. data/examples/complex-test-app/docs/api/api/v1/products/list.md +83 -0
  106. data/examples/complex-test-app/docs/api/api/v1/products/search.md +88 -0
  107. data/examples/complex-test-app/docs/api/api/v1/products/show.md +71 -0
  108. data/examples/complex-test-app/docs/api/api/v1/profiles/index.md +10 -0
  109. data/examples/complex-test-app/docs/api/api/v1/profiles/show.md +61 -0
  110. data/examples/complex-test-app/docs/api/api/v1/profiles/update.md +91 -0
  111. data/examples/complex-test-app/docs/api/api/v2/products/index.md +9 -0
  112. data/examples/complex-test-app/docs/api/api/v2/products/list.md +77 -0
  113. data/examples/complex-test-app/docs/api/curl/api/v1/admin/products/create.sh +18 -0
  114. data/examples/complex-test-app/docs/api/curl/api/v1/admin/products/destroy.sh +9 -0
  115. data/examples/complex-test-app/docs/api/curl/api/v1/admin/products/list.sh +9 -0
  116. data/examples/complex-test-app/docs/api/curl/api/v1/auth/login.sh +9 -0
  117. data/examples/complex-test-app/docs/api/curl/api/v1/cart-items/create.sh +16 -0
  118. data/examples/complex-test-app/docs/api/curl/api/v1/cart-items/destroy.sh +9 -0
  119. data/examples/complex-test-app/docs/api/curl/api/v1/carts/checkout.sh +13 -0
  120. data/examples/complex-test-app/docs/api/curl/api/v1/carts/show.sh +9 -0
  121. data/examples/complex-test-app/docs/api/curl/api/v1/home/list.sh +8 -0
  122. data/examples/complex-test-app/docs/api/curl/api/v1/notes/create.sh +15 -0
  123. data/examples/complex-test-app/docs/api/curl/api/v1/notes/list.sh +9 -0
  124. data/examples/complex-test-app/docs/api/curl/api/v1/orders/cancel.sh +9 -0
  125. data/examples/complex-test-app/docs/api/curl/api/v1/orders/create.sh +29 -0
  126. data/examples/complex-test-app/docs/api/curl/api/v1/orders/destroy.sh +9 -0
  127. data/examples/complex-test-app/docs/api/curl/api/v1/orders/list.sh +9 -0
  128. data/examples/complex-test-app/docs/api/curl/api/v1/orders/show.sh +9 -0
  129. data/examples/complex-test-app/docs/api/curl/api/v1/products/list.sh +8 -0
  130. data/examples/complex-test-app/docs/api/curl/api/v1/products/search.sh +8 -0
  131. data/examples/complex-test-app/docs/api/curl/api/v1/products/show.sh +8 -0
  132. data/examples/complex-test-app/docs/api/curl/api/v1/profiles/show.sh +9 -0
  133. data/examples/complex-test-app/docs/api/curl/api/v1/profiles/update.sh +16 -0
  134. data/examples/complex-test-app/docs/api/curl/api/v2/products/list.sh +8 -0
  135. data/examples/complex-test-app/docs/api/dataset.json +5109 -0
  136. data/examples/complex-test-app/docs/api/postman/collection.json +2568 -0
  137. data/examples/complex-test-app/generate.rb +14 -0
  138. data/examples/complex-test-app/reqcord.yml +28 -0
  139. data/examples/complex-test-app/test/integration/admin_test.rb +70 -0
  140. data/examples/complex-test-app/test/integration/cart_test.rb +64 -0
  141. data/examples/complex-test-app/test/integration/home_and_auth_test.rb +53 -0
  142. data/examples/complex-test-app/test/integration/orders_test.rb +127 -0
  143. data/examples/complex-test-app/test/integration/products_test.rb +66 -0
  144. data/examples/reqcord.yml +58 -0
  145. data/examples/spec-app/.rspec +1 -0
  146. data/examples/spec-app/README.md +36 -0
  147. data/examples/spec-app/app.rb +209 -0
  148. data/examples/spec-app/docs/api/README.md +45 -0
  149. data/examples/spec-app/docs/api/api/v1/customers/create.md +95 -0
  150. data/examples/spec-app/docs/api/api/v1/customers/index.md +11 -0
  151. data/examples/spec-app/docs/api/api/v1/customers/list.md +67 -0
  152. data/examples/spec-app/docs/api/api/v1/customers/show.md +65 -0
  153. data/examples/spec-app/docs/api/api/v1/tasks/complete.md +51 -0
  154. data/examples/spec-app/docs/api/api/v1/tasks/create.md +90 -0
  155. data/examples/spec-app/docs/api/api/v1/tasks/destroy.md +35 -0
  156. data/examples/spec-app/docs/api/api/v1/tasks/index.md +14 -0
  157. data/examples/spec-app/docs/api/api/v1/tasks/list.md +65 -0
  158. data/examples/spec-app/docs/api/api/v1/tasks/show.md +65 -0
  159. data/examples/spec-app/docs/api/api/v1/tasks/update.md +74 -0
  160. data/examples/spec-app/docs/api/api/v1/users/create.md +95 -0
  161. data/examples/spec-app/docs/api/api/v1/users/index.md +11 -0
  162. data/examples/spec-app/docs/api/api/v1/users/list.md +67 -0
  163. data/examples/spec-app/docs/api/api/v1/users/show.md +65 -0
  164. data/examples/spec-app/docs/api/curl/api/v1/customers/create.sh +17 -0
  165. data/examples/spec-app/docs/api/curl/api/v1/customers/list.sh +9 -0
  166. data/examples/spec-app/docs/api/curl/api/v1/customers/show.sh +9 -0
  167. data/examples/spec-app/docs/api/curl/api/v1/tasks/complete.sh +8 -0
  168. data/examples/spec-app/docs/api/curl/api/v1/tasks/create.sh +15 -0
  169. data/examples/spec-app/docs/api/curl/api/v1/tasks/destroy.sh +8 -0
  170. data/examples/spec-app/docs/api/curl/api/v1/tasks/list.sh +8 -0
  171. data/examples/spec-app/docs/api/curl/api/v1/tasks/show.sh +8 -0
  172. data/examples/spec-app/docs/api/curl/api/v1/tasks/update.sh +14 -0
  173. data/examples/spec-app/docs/api/curl/api/v1/users/create.sh +17 -0
  174. data/examples/spec-app/docs/api/curl/api/v1/users/list.sh +9 -0
  175. data/examples/spec-app/docs/api/curl/api/v1/users/show.sh +9 -0
  176. data/examples/spec-app/docs/api/dataset.json +2402 -0
  177. data/examples/spec-app/docs/api/postman/collection.json +1290 -0
  178. data/examples/spec-app/generate.rb +14 -0
  179. data/examples/spec-app/reqcord.yml +27 -0
  180. data/examples/spec-app/spec/requests/customers_spec.rb +71 -0
  181. data/examples/spec-app/spec/requests/tasks_spec.rb +78 -0
  182. data/examples/spec-app/spec/requests/users_spec.rb +68 -0
  183. data/examples/spec-app/spec/spec_helper.rb +17 -0
  184. data/examples/test-app/README.md +57 -0
  185. data/examples/test-app/app.rb +212 -0
  186. data/examples/test-app/docs/api/README.md +45 -0
  187. data/examples/test-app/docs/api/api/v1/customers/create.md +95 -0
  188. data/examples/test-app/docs/api/api/v1/customers/index.md +11 -0
  189. data/examples/test-app/docs/api/api/v1/customers/list.md +67 -0
  190. data/examples/test-app/docs/api/api/v1/customers/show.md +65 -0
  191. data/examples/test-app/docs/api/api/v1/tasks/complete.md +51 -0
  192. data/examples/test-app/docs/api/api/v1/tasks/create.md +90 -0
  193. data/examples/test-app/docs/api/api/v1/tasks/destroy.md +35 -0
  194. data/examples/test-app/docs/api/api/v1/tasks/index.md +14 -0
  195. data/examples/test-app/docs/api/api/v1/tasks/list.md +65 -0
  196. data/examples/test-app/docs/api/api/v1/tasks/show.md +65 -0
  197. data/examples/test-app/docs/api/api/v1/tasks/update.md +74 -0
  198. data/examples/test-app/docs/api/api/v1/users/create.md +95 -0
  199. data/examples/test-app/docs/api/api/v1/users/index.md +11 -0
  200. data/examples/test-app/docs/api/api/v1/users/list.md +67 -0
  201. data/examples/test-app/docs/api/api/v1/users/show.md +65 -0
  202. data/examples/test-app/docs/api/curl/api/v1/customers/create.sh +17 -0
  203. data/examples/test-app/docs/api/curl/api/v1/customers/list.sh +9 -0
  204. data/examples/test-app/docs/api/curl/api/v1/customers/show.sh +9 -0
  205. data/examples/test-app/docs/api/curl/api/v1/tasks/complete.sh +8 -0
  206. data/examples/test-app/docs/api/curl/api/v1/tasks/create.sh +15 -0
  207. data/examples/test-app/docs/api/curl/api/v1/tasks/destroy.sh +8 -0
  208. data/examples/test-app/docs/api/curl/api/v1/tasks/list.sh +8 -0
  209. data/examples/test-app/docs/api/curl/api/v1/tasks/show.sh +8 -0
  210. data/examples/test-app/docs/api/curl/api/v1/tasks/update.sh +14 -0
  211. data/examples/test-app/docs/api/curl/api/v1/users/create.sh +17 -0
  212. data/examples/test-app/docs/api/curl/api/v1/users/list.sh +9 -0
  213. data/examples/test-app/docs/api/curl/api/v1/users/show.sh +9 -0
  214. data/examples/test-app/docs/api/dataset.json +2402 -0
  215. data/examples/test-app/docs/api/postman/collection.json +1290 -0
  216. data/examples/test-app/generate.rb +14 -0
  217. data/examples/test-app/reqcord.yml +28 -0
  218. data/examples/test-app/test/integration/customers_test.rb +72 -0
  219. data/examples/test-app/test/integration/tasks_test.rb +80 -0
  220. data/examples/test-app/test/integration/users_test.rb +72 -0
  221. data/lib/reqcord/capture/collector.rb +31 -0
  222. data/lib/reqcord/capture/integration_patch.rb +209 -0
  223. data/lib/reqcord/capture/minitest_context.rb +34 -0
  224. data/lib/reqcord/capture/rspec_context.rb +42 -0
  225. data/lib/reqcord/capture/test_context.rb +25 -0
  226. data/lib/reqcord/capture.rb +19 -0
  227. data/lib/reqcord/configuration.rb +198 -0
  228. data/lib/reqcord/dataset.rb +176 -0
  229. data/lib/reqcord/endpoint.rb +263 -0
  230. data/lib/reqcord/errors.rb +9 -0
  231. data/lib/reqcord/exporters/curl.rb +68 -0
  232. data/lib/reqcord/exporters/markdown.rb +295 -0
  233. data/lib/reqcord/exporters/postman.rb +206 -0
  234. data/lib/reqcord/exporters.rb +32 -0
  235. data/lib/reqcord/generator.rb +364 -0
  236. data/lib/reqcord/railtie.rb +51 -0
  237. data/lib/reqcord/renderers/curl.rb +56 -0
  238. data/lib/reqcord/renderers/payload.rb +69 -0
  239. data/lib/reqcord/request_example.rb +104 -0
  240. data/lib/reqcord/response_example.rb +72 -0
  241. data/lib/reqcord/route_collector.rb +242 -0
  242. data/lib/reqcord/sanitizers/sanitizer.rb +140 -0
  243. data/lib/reqcord/schema.rb +187 -0
  244. data/lib/reqcord/support.rb +58 -0
  245. data/lib/reqcord/version.rb +5 -0
  246. data/lib/reqcord.rb +78 -0
  247. data/lib/tasks/reqcord.rake +99 -0
  248. data/reqcord.gemspec +46 -0
  249. metadata +317 -3
@@ -0,0 +1,2402 @@
1
+ {
2
+ "schema_version": 2,
3
+ "generated_at": "2026-09-15T21:26:54Z",
4
+ "endpoints": [
5
+ {
6
+ "name": "List Customers",
7
+ "method": "GET",
8
+ "path": "/api/v1/customers",
9
+ "controller": "api/v1/customers",
10
+ "action": "index",
11
+ "resource": "customers",
12
+ "api_version": "v1",
13
+ "route_name": "api_v1_customers",
14
+ "also_methods": [],
15
+ "path_params": [],
16
+ "parameters": {
17
+ "path": [],
18
+ "query": [
19
+ {
20
+ "path": "per_page",
21
+ "type": "integer",
22
+ "required": true,
23
+ "values": [
24
+ 1
25
+ ]
26
+ }
27
+ ],
28
+ "body": []
29
+ },
30
+ "responses": [
31
+ {
32
+ "status": 200,
33
+ "schema": [
34
+ {
35
+ "path": "[].id",
36
+ "type": "integer",
37
+ "required": true,
38
+ "values": [
39
+ 1
40
+ ]
41
+ },
42
+ {
43
+ "path": "[].name",
44
+ "type": "string",
45
+ "required": true,
46
+ "values": [
47
+ "John Doe"
48
+ ]
49
+ },
50
+ {
51
+ "path": "[].email",
52
+ "type": "string",
53
+ "required": true,
54
+ "values": [
55
+ "john@example.com"
56
+ ]
57
+ }
58
+ ],
59
+ "example": [
60
+ {
61
+ "id": 1,
62
+ "name": "John Doe",
63
+ "email": "john@example.com"
64
+ }
65
+ ],
66
+ "headers": {
67
+ "content-type": "application/json; charset=utf-8"
68
+ },
69
+ "content_type": "application/json"
70
+ },
71
+ {
72
+ "status": 401,
73
+ "schema": [
74
+ {
75
+ "path": "error",
76
+ "type": "string",
77
+ "required": true,
78
+ "values": [
79
+ "Unauthorized"
80
+ ]
81
+ }
82
+ ],
83
+ "example": {
84
+ "error": "Unauthorized"
85
+ },
86
+ "headers": {
87
+ "content-type": "application/json; charset=utf-8"
88
+ },
89
+ "content_type": "application/json"
90
+ }
91
+ ],
92
+ "request_examples": [
93
+ {
94
+ "name": "Lists Customers",
95
+ "method": "GET",
96
+ "path": "/api/v1/customers",
97
+ "path_params": {},
98
+ "query_params": {
99
+ "per_page": 1
100
+ },
101
+ "headers": {
102
+ "Authorization": "Bearer {{token}}",
103
+ "Accept": "application/json"
104
+ },
105
+ "body": null,
106
+ "content_type": null,
107
+ "response_status": 200,
108
+ "source": {
109
+ "test": "lists customers",
110
+ "suite": "Customers",
111
+ "file": "./spec/requests/customers_spec.rb",
112
+ "line": 12
113
+ }
114
+ },
115
+ {
116
+ "name": "Requires Authentication",
117
+ "method": "GET",
118
+ "path": "/api/v1/customers",
119
+ "path_params": {},
120
+ "query_params": {},
121
+ "headers": {
122
+ "Accept": "application/json"
123
+ },
124
+ "body": null,
125
+ "content_type": null,
126
+ "response_status": 401,
127
+ "source": {
128
+ "test": "requires authentication",
129
+ "suite": "Customers",
130
+ "file": "./spec/requests/customers_spec.rb",
131
+ "line": 66
132
+ }
133
+ }
134
+ ],
135
+ "response_examples": [
136
+ {
137
+ "name": "Lists Customers",
138
+ "status": 200,
139
+ "headers": {
140
+ "content-type": "application/json; charset=utf-8"
141
+ },
142
+ "body": [
143
+ {
144
+ "id": 1,
145
+ "name": "John Doe",
146
+ "email": "john@example.com"
147
+ }
148
+ ],
149
+ "content_type": "application/json",
150
+ "source": {
151
+ "test": "lists customers",
152
+ "suite": "Customers",
153
+ "file": "./spec/requests/customers_spec.rb",
154
+ "line": 12
155
+ }
156
+ },
157
+ {
158
+ "name": "Requires Authentication",
159
+ "status": 401,
160
+ "headers": {
161
+ "content-type": "application/json; charset=utf-8"
162
+ },
163
+ "body": {
164
+ "error": "Unauthorized"
165
+ },
166
+ "content_type": "application/json",
167
+ "source": {
168
+ "test": "requires authentication",
169
+ "suite": "Customers",
170
+ "file": "./spec/requests/customers_spec.rb",
171
+ "line": 66
172
+ }
173
+ }
174
+ ]
175
+ },
176
+ {
177
+ "name": "Create Customer",
178
+ "method": "POST",
179
+ "path": "/api/v1/customers",
180
+ "controller": "api/v1/customers",
181
+ "action": "create",
182
+ "resource": "customers",
183
+ "api_version": "v1",
184
+ "route_name": null,
185
+ "also_methods": [],
186
+ "path_params": [],
187
+ "parameters": {
188
+ "path": [],
189
+ "query": [],
190
+ "body": [
191
+ {
192
+ "path": "customer.name",
193
+ "type": "string",
194
+ "required": true,
195
+ "values": [
196
+ "Ada Lovelace",
197
+ "Grace Hopper"
198
+ ]
199
+ },
200
+ {
201
+ "path": "customer.email",
202
+ "type": "string",
203
+ "required": true,
204
+ "values": [
205
+ "ada@example.com",
206
+ "grace@example.com"
207
+ ]
208
+ },
209
+ {
210
+ "path": "customer.status",
211
+ "type": "string",
212
+ "required": true,
213
+ "values": [
214
+ "active",
215
+ "passive"
216
+ ]
217
+ }
218
+ ]
219
+ },
220
+ "responses": [
221
+ {
222
+ "status": 201,
223
+ "schema": [
224
+ {
225
+ "path": "id",
226
+ "type": "integer",
227
+ "required": true,
228
+ "values": [
229
+ 3
230
+ ]
231
+ },
232
+ {
233
+ "path": "name",
234
+ "type": "string",
235
+ "required": true,
236
+ "values": [
237
+ "Ada Lovelace",
238
+ "Grace Hopper"
239
+ ]
240
+ },
241
+ {
242
+ "path": "email",
243
+ "type": "string",
244
+ "required": true,
245
+ "values": [
246
+ "ada@example.com",
247
+ "grace@example.com"
248
+ ]
249
+ },
250
+ {
251
+ "path": "status",
252
+ "type": "string",
253
+ "required": true,
254
+ "values": [
255
+ "active",
256
+ "passive"
257
+ ]
258
+ }
259
+ ],
260
+ "example": {
261
+ "id": 3,
262
+ "name": "Ada Lovelace",
263
+ "email": "ada@example.com",
264
+ "status": "active"
265
+ },
266
+ "headers": {
267
+ "content-type": "application/json; charset=utf-8"
268
+ },
269
+ "content_type": "application/json"
270
+ },
271
+ {
272
+ "status": 422,
273
+ "schema": [
274
+ {
275
+ "path": "errors.status[]",
276
+ "type": "string",
277
+ "required": false,
278
+ "values": [
279
+ "is not included in the list"
280
+ ]
281
+ },
282
+ {
283
+ "path": "errors.email[]",
284
+ "type": "string",
285
+ "required": false,
286
+ "values": [
287
+ "can't be blank"
288
+ ]
289
+ }
290
+ ],
291
+ "example": {
292
+ "errors": {
293
+ "status": [
294
+ "is not included in the list"
295
+ ]
296
+ }
297
+ },
298
+ "headers": {
299
+ "content-type": "application/json; charset=utf-8"
300
+ },
301
+ "content_type": "application/json"
302
+ }
303
+ ],
304
+ "request_examples": [
305
+ {
306
+ "name": "Creates An Active Customer",
307
+ "method": "POST",
308
+ "path": "/api/v1/customers",
309
+ "path_params": {},
310
+ "query_params": {},
311
+ "headers": {
312
+ "Authorization": "Bearer {{token}}",
313
+ "Content-Type": "application/json",
314
+ "Accept": "application/json"
315
+ },
316
+ "body": {
317
+ "customer": {
318
+ "name": "Ada Lovelace",
319
+ "email": "ada@example.com",
320
+ "status": "active"
321
+ }
322
+ },
323
+ "content_type": "application/json",
324
+ "response_status": 201,
325
+ "source": {
326
+ "test": "creates an active customer",
327
+ "suite": "Customers",
328
+ "file": "./spec/requests/customers_spec.rb",
329
+ "line": 30
330
+ }
331
+ },
332
+ {
333
+ "name": "Creates A Passive Customer",
334
+ "method": "POST",
335
+ "path": "/api/v1/customers",
336
+ "path_params": {},
337
+ "query_params": {},
338
+ "headers": {
339
+ "Authorization": "Bearer {{token}}",
340
+ "Content-Type": "application/json",
341
+ "Accept": "application/json"
342
+ },
343
+ "body": {
344
+ "customer": {
345
+ "name": "Grace Hopper",
346
+ "email": "grace@example.com",
347
+ "status": "passive"
348
+ }
349
+ },
350
+ "content_type": "application/json",
351
+ "response_status": 201,
352
+ "source": {
353
+ "test": "creates a passive customer",
354
+ "suite": "Customers",
355
+ "file": "./spec/requests/customers_spec.rb",
356
+ "line": 39
357
+ }
358
+ },
359
+ {
360
+ "name": "Rejects An Unknown Status",
361
+ "method": "POST",
362
+ "path": "/api/v1/customers",
363
+ "path_params": {},
364
+ "query_params": {},
365
+ "headers": {
366
+ "Authorization": "Bearer {{token}}",
367
+ "Content-Type": "application/json",
368
+ "Accept": "application/json"
369
+ },
370
+ "body": {
371
+ "customer": {
372
+ "name": "Ada Lovelace",
373
+ "email": "ada@example.com",
374
+ "status": "inactive"
375
+ }
376
+ },
377
+ "content_type": "application/json",
378
+ "response_status": 422,
379
+ "source": {
380
+ "test": "rejects an unknown status",
381
+ "suite": "Customers",
382
+ "file": "./spec/requests/customers_spec.rb",
383
+ "line": 48
384
+ }
385
+ },
386
+ {
387
+ "name": "Rejects A Customer Without An Email",
388
+ "method": "POST",
389
+ "path": "/api/v1/customers",
390
+ "path_params": {},
391
+ "query_params": {},
392
+ "headers": {
393
+ "Authorization": "Bearer {{token}}",
394
+ "Content-Type": "application/json",
395
+ "Accept": "application/json"
396
+ },
397
+ "body": {
398
+ "customer": {
399
+ "name": "Ada Lovelace",
400
+ "email": "",
401
+ "status": "active"
402
+ }
403
+ },
404
+ "content_type": "application/json",
405
+ "response_status": 422,
406
+ "source": {
407
+ "test": "rejects a customer without an email",
408
+ "suite": "Customers",
409
+ "file": "./spec/requests/customers_spec.rb",
410
+ "line": 57
411
+ }
412
+ }
413
+ ],
414
+ "response_examples": [
415
+ {
416
+ "name": "Creates An Active Customer",
417
+ "status": 201,
418
+ "headers": {
419
+ "content-type": "application/json; charset=utf-8"
420
+ },
421
+ "body": {
422
+ "id": 3,
423
+ "name": "Ada Lovelace",
424
+ "email": "ada@example.com",
425
+ "status": "active"
426
+ },
427
+ "content_type": "application/json",
428
+ "source": {
429
+ "test": "creates an active customer",
430
+ "suite": "Customers",
431
+ "file": "./spec/requests/customers_spec.rb",
432
+ "line": 30
433
+ }
434
+ },
435
+ {
436
+ "name": "Creates A Passive Customer",
437
+ "status": 201,
438
+ "headers": {
439
+ "content-type": "application/json; charset=utf-8"
440
+ },
441
+ "body": {
442
+ "id": 3,
443
+ "name": "Grace Hopper",
444
+ "email": "grace@example.com",
445
+ "status": "passive"
446
+ },
447
+ "content_type": "application/json",
448
+ "source": {
449
+ "test": "creates a passive customer",
450
+ "suite": "Customers",
451
+ "file": "./spec/requests/customers_spec.rb",
452
+ "line": 39
453
+ }
454
+ },
455
+ {
456
+ "name": "Rejects An Unknown Status",
457
+ "status": 422,
458
+ "headers": {
459
+ "content-type": "application/json; charset=utf-8"
460
+ },
461
+ "body": {
462
+ "errors": {
463
+ "status": [
464
+ "is not included in the list"
465
+ ]
466
+ }
467
+ },
468
+ "content_type": "application/json",
469
+ "source": {
470
+ "test": "rejects an unknown status",
471
+ "suite": "Customers",
472
+ "file": "./spec/requests/customers_spec.rb",
473
+ "line": 48
474
+ }
475
+ },
476
+ {
477
+ "name": "Rejects A Customer Without An Email",
478
+ "status": 422,
479
+ "headers": {
480
+ "content-type": "application/json; charset=utf-8"
481
+ },
482
+ "body": {
483
+ "errors": {
484
+ "email": [
485
+ "can't be blank"
486
+ ]
487
+ }
488
+ },
489
+ "content_type": "application/json",
490
+ "source": {
491
+ "test": "rejects a customer without an email",
492
+ "suite": "Customers",
493
+ "file": "./spec/requests/customers_spec.rb",
494
+ "line": 57
495
+ }
496
+ }
497
+ ]
498
+ },
499
+ {
500
+ "name": "Get Customer",
501
+ "method": "GET",
502
+ "path": "/api/v1/customers/:id",
503
+ "controller": "api/v1/customers",
504
+ "action": "show",
505
+ "resource": "customers",
506
+ "api_version": "v1",
507
+ "route_name": "api_v1_customer",
508
+ "also_methods": [],
509
+ "path_params": [
510
+ "id"
511
+ ],
512
+ "parameters": {
513
+ "path": [
514
+ {
515
+ "path": "id",
516
+ "type": "string",
517
+ "required": true,
518
+ "values": [
519
+ "1"
520
+ ]
521
+ }
522
+ ],
523
+ "query": [],
524
+ "body": []
525
+ },
526
+ "responses": [
527
+ {
528
+ "status": 200,
529
+ "schema": [
530
+ {
531
+ "path": "id",
532
+ "type": "integer",
533
+ "required": true,
534
+ "values": [
535
+ 1
536
+ ]
537
+ },
538
+ {
539
+ "path": "name",
540
+ "type": "string",
541
+ "required": true,
542
+ "values": [
543
+ "John Doe"
544
+ ]
545
+ },
546
+ {
547
+ "path": "email",
548
+ "type": "string",
549
+ "required": true,
550
+ "values": [
551
+ "john@example.com"
552
+ ]
553
+ }
554
+ ],
555
+ "example": {
556
+ "id": 1,
557
+ "name": "John Doe",
558
+ "email": "john@example.com"
559
+ },
560
+ "headers": {
561
+ "content-type": "application/json; charset=utf-8"
562
+ },
563
+ "content_type": "application/json"
564
+ },
565
+ {
566
+ "status": 404,
567
+ "schema": [
568
+ {
569
+ "path": "error",
570
+ "type": "string",
571
+ "required": true,
572
+ "values": [
573
+ "Not Found"
574
+ ]
575
+ }
576
+ ],
577
+ "example": {
578
+ "error": "Not Found"
579
+ },
580
+ "headers": {
581
+ "content-type": "application/json; charset=utf-8"
582
+ },
583
+ "content_type": "application/json"
584
+ }
585
+ ],
586
+ "request_examples": [
587
+ {
588
+ "name": "Shows Customer",
589
+ "method": "GET",
590
+ "path": "/api/v1/customers/1",
591
+ "path_params": {
592
+ "id": "1"
593
+ },
594
+ "query_params": {},
595
+ "headers": {
596
+ "Authorization": "Bearer {{token}}",
597
+ "Accept": "application/json"
598
+ },
599
+ "body": null,
600
+ "content_type": null,
601
+ "response_status": 200,
602
+ "source": {
603
+ "test": "shows customer",
604
+ "suite": "Customers",
605
+ "file": "./spec/requests/customers_spec.rb",
606
+ "line": 18
607
+ }
608
+ },
609
+ {
610
+ "name": "Returns Not Found For An Unknown Customer",
611
+ "method": "GET",
612
+ "path": "/api/v1/customers/999",
613
+ "path_params": {
614
+ "id": "999"
615
+ },
616
+ "query_params": {},
617
+ "headers": {
618
+ "Authorization": "Bearer {{token}}",
619
+ "Accept": "application/json"
620
+ },
621
+ "body": null,
622
+ "content_type": null,
623
+ "response_status": 404,
624
+ "source": {
625
+ "test": "returns not found for an unknown customer",
626
+ "suite": "Customers",
627
+ "file": "./spec/requests/customers_spec.rb",
628
+ "line": 24
629
+ }
630
+ }
631
+ ],
632
+ "response_examples": [
633
+ {
634
+ "name": "Shows Customer",
635
+ "status": 200,
636
+ "headers": {
637
+ "content-type": "application/json; charset=utf-8"
638
+ },
639
+ "body": {
640
+ "id": 1,
641
+ "name": "John Doe",
642
+ "email": "john@example.com"
643
+ },
644
+ "content_type": "application/json",
645
+ "source": {
646
+ "test": "shows customer",
647
+ "suite": "Customers",
648
+ "file": "./spec/requests/customers_spec.rb",
649
+ "line": 18
650
+ }
651
+ },
652
+ {
653
+ "name": "Returns Not Found For An Unknown Customer",
654
+ "status": 404,
655
+ "headers": {
656
+ "content-type": "application/json; charset=utf-8"
657
+ },
658
+ "body": {
659
+ "error": "Not Found"
660
+ },
661
+ "content_type": "application/json",
662
+ "source": {
663
+ "test": "returns not found for an unknown customer",
664
+ "suite": "Customers",
665
+ "file": "./spec/requests/customers_spec.rb",
666
+ "line": 24
667
+ }
668
+ }
669
+ ]
670
+ },
671
+ {
672
+ "name": "List Users",
673
+ "method": "GET",
674
+ "path": "/api/v1/users",
675
+ "controller": "api/v1/users",
676
+ "action": "index",
677
+ "resource": "users",
678
+ "api_version": "v1",
679
+ "route_name": "api_v1_users",
680
+ "also_methods": [],
681
+ "path_params": [],
682
+ "parameters": {
683
+ "path": [],
684
+ "query": [
685
+ {
686
+ "path": "per_page",
687
+ "type": "integer",
688
+ "required": true,
689
+ "values": [
690
+ 1
691
+ ]
692
+ }
693
+ ],
694
+ "body": []
695
+ },
696
+ "responses": [
697
+ {
698
+ "status": 200,
699
+ "schema": [
700
+ {
701
+ "path": "[].id",
702
+ "type": "integer",
703
+ "required": true,
704
+ "values": [
705
+ 1
706
+ ]
707
+ },
708
+ {
709
+ "path": "[].name",
710
+ "type": "string",
711
+ "required": true,
712
+ "values": [
713
+ "John Doe"
714
+ ]
715
+ },
716
+ {
717
+ "path": "[].email",
718
+ "type": "string",
719
+ "required": true,
720
+ "values": [
721
+ "john@example.com"
722
+ ]
723
+ }
724
+ ],
725
+ "example": [
726
+ {
727
+ "id": 1,
728
+ "name": "John Doe",
729
+ "email": "john@example.com"
730
+ }
731
+ ],
732
+ "headers": {
733
+ "content-type": "application/json; charset=utf-8"
734
+ },
735
+ "content_type": "application/json"
736
+ },
737
+ {
738
+ "status": 401,
739
+ "schema": [
740
+ {
741
+ "path": "error",
742
+ "type": "string",
743
+ "required": true,
744
+ "values": [
745
+ "Unauthorized"
746
+ ]
747
+ }
748
+ ],
749
+ "example": {
750
+ "error": "Unauthorized"
751
+ },
752
+ "headers": {
753
+ "content-type": "application/json; charset=utf-8"
754
+ },
755
+ "content_type": "application/json"
756
+ }
757
+ ],
758
+ "request_examples": [
759
+ {
760
+ "name": "Lists Users",
761
+ "method": "GET",
762
+ "path": "/api/v1/users",
763
+ "path_params": {},
764
+ "query_params": {
765
+ "per_page": 1
766
+ },
767
+ "headers": {
768
+ "Authorization": "Bearer {{token}}",
769
+ "Accept": "application/json"
770
+ },
771
+ "body": null,
772
+ "content_type": null,
773
+ "response_status": 200,
774
+ "source": {
775
+ "test": "lists users",
776
+ "suite": "Users",
777
+ "file": "./spec/requests/users_spec.rb",
778
+ "line": 9
779
+ }
780
+ },
781
+ {
782
+ "name": "Requires Authentication",
783
+ "method": "GET",
784
+ "path": "/api/v1/users",
785
+ "path_params": {},
786
+ "query_params": {},
787
+ "headers": {
788
+ "Accept": "application/json"
789
+ },
790
+ "body": null,
791
+ "content_type": null,
792
+ "response_status": 401,
793
+ "source": {
794
+ "test": "requires authentication",
795
+ "suite": "Users",
796
+ "file": "./spec/requests/users_spec.rb",
797
+ "line": 63
798
+ }
799
+ }
800
+ ],
801
+ "response_examples": [
802
+ {
803
+ "name": "Lists Users",
804
+ "status": 200,
805
+ "headers": {
806
+ "content-type": "application/json; charset=utf-8"
807
+ },
808
+ "body": [
809
+ {
810
+ "id": 1,
811
+ "name": "John Doe",
812
+ "email": "john@example.com"
813
+ }
814
+ ],
815
+ "content_type": "application/json",
816
+ "source": {
817
+ "test": "lists users",
818
+ "suite": "Users",
819
+ "file": "./spec/requests/users_spec.rb",
820
+ "line": 9
821
+ }
822
+ },
823
+ {
824
+ "name": "Requires Authentication",
825
+ "status": 401,
826
+ "headers": {
827
+ "content-type": "application/json; charset=utf-8"
828
+ },
829
+ "body": {
830
+ "error": "Unauthorized"
831
+ },
832
+ "content_type": "application/json",
833
+ "source": {
834
+ "test": "requires authentication",
835
+ "suite": "Users",
836
+ "file": "./spec/requests/users_spec.rb",
837
+ "line": 63
838
+ }
839
+ }
840
+ ]
841
+ },
842
+ {
843
+ "name": "Create User",
844
+ "method": "POST",
845
+ "path": "/api/v1/users",
846
+ "controller": "api/v1/users",
847
+ "action": "create",
848
+ "resource": "users",
849
+ "api_version": "v1",
850
+ "route_name": null,
851
+ "also_methods": [],
852
+ "path_params": [],
853
+ "parameters": {
854
+ "path": [],
855
+ "query": [],
856
+ "body": [
857
+ {
858
+ "path": "user.name",
859
+ "type": "string",
860
+ "required": true,
861
+ "values": [
862
+ "Ada Lovelace",
863
+ "Grace Hopper"
864
+ ]
865
+ },
866
+ {
867
+ "path": "user.email",
868
+ "type": "string",
869
+ "required": true,
870
+ "values": [
871
+ "ada@example.com",
872
+ "grace@example.com"
873
+ ]
874
+ },
875
+ {
876
+ "path": "user.status",
877
+ "type": "string",
878
+ "required": true,
879
+ "values": [
880
+ "active",
881
+ "inactive"
882
+ ]
883
+ }
884
+ ]
885
+ },
886
+ "responses": [
887
+ {
888
+ "status": 201,
889
+ "schema": [
890
+ {
891
+ "path": "id",
892
+ "type": "integer",
893
+ "required": true,
894
+ "values": [
895
+ 3
896
+ ]
897
+ },
898
+ {
899
+ "path": "name",
900
+ "type": "string",
901
+ "required": true,
902
+ "values": [
903
+ "Ada Lovelace",
904
+ "Grace Hopper"
905
+ ]
906
+ },
907
+ {
908
+ "path": "email",
909
+ "type": "string",
910
+ "required": true,
911
+ "values": [
912
+ "ada@example.com",
913
+ "grace@example.com"
914
+ ]
915
+ },
916
+ {
917
+ "path": "status",
918
+ "type": "string",
919
+ "required": true,
920
+ "values": [
921
+ "active",
922
+ "inactive"
923
+ ]
924
+ }
925
+ ],
926
+ "example": {
927
+ "id": 3,
928
+ "name": "Ada Lovelace",
929
+ "email": "ada@example.com",
930
+ "status": "active"
931
+ },
932
+ "headers": {
933
+ "content-type": "application/json; charset=utf-8"
934
+ },
935
+ "content_type": "application/json"
936
+ },
937
+ {
938
+ "status": 422,
939
+ "schema": [
940
+ {
941
+ "path": "errors.status[]",
942
+ "type": "string",
943
+ "required": false,
944
+ "values": [
945
+ "is not included in the list"
946
+ ]
947
+ },
948
+ {
949
+ "path": "errors.email[]",
950
+ "type": "string",
951
+ "required": false,
952
+ "values": [
953
+ "can't be blank"
954
+ ]
955
+ }
956
+ ],
957
+ "example": {
958
+ "errors": {
959
+ "status": [
960
+ "is not included in the list"
961
+ ]
962
+ }
963
+ },
964
+ "headers": {
965
+ "content-type": "application/json; charset=utf-8"
966
+ },
967
+ "content_type": "application/json"
968
+ }
969
+ ],
970
+ "request_examples": [
971
+ {
972
+ "name": "Creates An Active User",
973
+ "method": "POST",
974
+ "path": "/api/v1/users",
975
+ "path_params": {},
976
+ "query_params": {},
977
+ "headers": {
978
+ "Authorization": "Bearer {{token}}",
979
+ "Content-Type": "application/json",
980
+ "Accept": "application/json"
981
+ },
982
+ "body": {
983
+ "user": {
984
+ "name": "Ada Lovelace",
985
+ "email": "ada@example.com",
986
+ "status": "active"
987
+ }
988
+ },
989
+ "content_type": "application/json",
990
+ "response_status": 201,
991
+ "source": {
992
+ "test": "creates an active user",
993
+ "suite": "Users",
994
+ "file": "./spec/requests/users_spec.rb",
995
+ "line": 27
996
+ }
997
+ },
998
+ {
999
+ "name": "Creates An Inactive User",
1000
+ "method": "POST",
1001
+ "path": "/api/v1/users",
1002
+ "path_params": {},
1003
+ "query_params": {},
1004
+ "headers": {
1005
+ "Authorization": "Bearer {{token}}",
1006
+ "Content-Type": "application/json",
1007
+ "Accept": "application/json"
1008
+ },
1009
+ "body": {
1010
+ "user": {
1011
+ "name": "Grace Hopper",
1012
+ "email": "grace@example.com",
1013
+ "status": "inactive"
1014
+ }
1015
+ },
1016
+ "content_type": "application/json",
1017
+ "response_status": 201,
1018
+ "source": {
1019
+ "test": "creates an inactive user",
1020
+ "suite": "Users",
1021
+ "file": "./spec/requests/users_spec.rb",
1022
+ "line": 36
1023
+ }
1024
+ },
1025
+ {
1026
+ "name": "Rejects An Unknown Status",
1027
+ "method": "POST",
1028
+ "path": "/api/v1/users",
1029
+ "path_params": {},
1030
+ "query_params": {},
1031
+ "headers": {
1032
+ "Authorization": "Bearer {{token}}",
1033
+ "Content-Type": "application/json",
1034
+ "Accept": "application/json"
1035
+ },
1036
+ "body": {
1037
+ "user": {
1038
+ "name": "Ada Lovelace",
1039
+ "email": "ada@example.com",
1040
+ "status": "passive"
1041
+ }
1042
+ },
1043
+ "content_type": "application/json",
1044
+ "response_status": 422,
1045
+ "source": {
1046
+ "test": "rejects an unknown status",
1047
+ "suite": "Users",
1048
+ "file": "./spec/requests/users_spec.rb",
1049
+ "line": 45
1050
+ }
1051
+ },
1052
+ {
1053
+ "name": "Rejects A User Without An Email",
1054
+ "method": "POST",
1055
+ "path": "/api/v1/users",
1056
+ "path_params": {},
1057
+ "query_params": {},
1058
+ "headers": {
1059
+ "Authorization": "Bearer {{token}}",
1060
+ "Content-Type": "application/json",
1061
+ "Accept": "application/json"
1062
+ },
1063
+ "body": {
1064
+ "user": {
1065
+ "name": "Ada Lovelace",
1066
+ "email": "",
1067
+ "status": "active"
1068
+ }
1069
+ },
1070
+ "content_type": "application/json",
1071
+ "response_status": 422,
1072
+ "source": {
1073
+ "test": "rejects a user without an email",
1074
+ "suite": "Users",
1075
+ "file": "./spec/requests/users_spec.rb",
1076
+ "line": 54
1077
+ }
1078
+ }
1079
+ ],
1080
+ "response_examples": [
1081
+ {
1082
+ "name": "Creates An Active User",
1083
+ "status": 201,
1084
+ "headers": {
1085
+ "content-type": "application/json; charset=utf-8"
1086
+ },
1087
+ "body": {
1088
+ "id": 3,
1089
+ "name": "Ada Lovelace",
1090
+ "email": "ada@example.com",
1091
+ "status": "active"
1092
+ },
1093
+ "content_type": "application/json",
1094
+ "source": {
1095
+ "test": "creates an active user",
1096
+ "suite": "Users",
1097
+ "file": "./spec/requests/users_spec.rb",
1098
+ "line": 27
1099
+ }
1100
+ },
1101
+ {
1102
+ "name": "Creates An Inactive User",
1103
+ "status": 201,
1104
+ "headers": {
1105
+ "content-type": "application/json; charset=utf-8"
1106
+ },
1107
+ "body": {
1108
+ "id": 3,
1109
+ "name": "Grace Hopper",
1110
+ "email": "grace@example.com",
1111
+ "status": "inactive"
1112
+ },
1113
+ "content_type": "application/json",
1114
+ "source": {
1115
+ "test": "creates an inactive user",
1116
+ "suite": "Users",
1117
+ "file": "./spec/requests/users_spec.rb",
1118
+ "line": 36
1119
+ }
1120
+ },
1121
+ {
1122
+ "name": "Rejects An Unknown Status",
1123
+ "status": 422,
1124
+ "headers": {
1125
+ "content-type": "application/json; charset=utf-8"
1126
+ },
1127
+ "body": {
1128
+ "errors": {
1129
+ "status": [
1130
+ "is not included in the list"
1131
+ ]
1132
+ }
1133
+ },
1134
+ "content_type": "application/json",
1135
+ "source": {
1136
+ "test": "rejects an unknown status",
1137
+ "suite": "Users",
1138
+ "file": "./spec/requests/users_spec.rb",
1139
+ "line": 45
1140
+ }
1141
+ },
1142
+ {
1143
+ "name": "Rejects A User Without An Email",
1144
+ "status": 422,
1145
+ "headers": {
1146
+ "content-type": "application/json; charset=utf-8"
1147
+ },
1148
+ "body": {
1149
+ "errors": {
1150
+ "email": [
1151
+ "can't be blank"
1152
+ ]
1153
+ }
1154
+ },
1155
+ "content_type": "application/json",
1156
+ "source": {
1157
+ "test": "rejects a user without an email",
1158
+ "suite": "Users",
1159
+ "file": "./spec/requests/users_spec.rb",
1160
+ "line": 54
1161
+ }
1162
+ }
1163
+ ]
1164
+ },
1165
+ {
1166
+ "name": "Get User",
1167
+ "method": "GET",
1168
+ "path": "/api/v1/users/:id",
1169
+ "controller": "api/v1/users",
1170
+ "action": "show",
1171
+ "resource": "users",
1172
+ "api_version": "v1",
1173
+ "route_name": "api_v1_user",
1174
+ "also_methods": [],
1175
+ "path_params": [
1176
+ "id"
1177
+ ],
1178
+ "parameters": {
1179
+ "path": [
1180
+ {
1181
+ "path": "id",
1182
+ "type": "string",
1183
+ "required": true,
1184
+ "values": [
1185
+ "1"
1186
+ ]
1187
+ }
1188
+ ],
1189
+ "query": [],
1190
+ "body": []
1191
+ },
1192
+ "responses": [
1193
+ {
1194
+ "status": 200,
1195
+ "schema": [
1196
+ {
1197
+ "path": "id",
1198
+ "type": "integer",
1199
+ "required": true,
1200
+ "values": [
1201
+ 1
1202
+ ]
1203
+ },
1204
+ {
1205
+ "path": "name",
1206
+ "type": "string",
1207
+ "required": true,
1208
+ "values": [
1209
+ "John Doe"
1210
+ ]
1211
+ },
1212
+ {
1213
+ "path": "email",
1214
+ "type": "string",
1215
+ "required": true,
1216
+ "values": [
1217
+ "john@example.com"
1218
+ ]
1219
+ }
1220
+ ],
1221
+ "example": {
1222
+ "id": 1,
1223
+ "name": "John Doe",
1224
+ "email": "john@example.com"
1225
+ },
1226
+ "headers": {
1227
+ "content-type": "application/json; charset=utf-8"
1228
+ },
1229
+ "content_type": "application/json"
1230
+ },
1231
+ {
1232
+ "status": 404,
1233
+ "schema": [
1234
+ {
1235
+ "path": "error",
1236
+ "type": "string",
1237
+ "required": true,
1238
+ "values": [
1239
+ "Not Found"
1240
+ ]
1241
+ }
1242
+ ],
1243
+ "example": {
1244
+ "error": "Not Found"
1245
+ },
1246
+ "headers": {
1247
+ "content-type": "application/json; charset=utf-8"
1248
+ },
1249
+ "content_type": "application/json"
1250
+ }
1251
+ ],
1252
+ "request_examples": [
1253
+ {
1254
+ "name": "Shows User",
1255
+ "method": "GET",
1256
+ "path": "/api/v1/users/1",
1257
+ "path_params": {
1258
+ "id": "1"
1259
+ },
1260
+ "query_params": {},
1261
+ "headers": {
1262
+ "Authorization": "Bearer {{token}}",
1263
+ "Accept": "application/json"
1264
+ },
1265
+ "body": null,
1266
+ "content_type": null,
1267
+ "response_status": 200,
1268
+ "source": {
1269
+ "test": "shows user",
1270
+ "suite": "Users",
1271
+ "file": "./spec/requests/users_spec.rb",
1272
+ "line": 15
1273
+ }
1274
+ },
1275
+ {
1276
+ "name": "Returns Not Found For An Unknown User",
1277
+ "method": "GET",
1278
+ "path": "/api/v1/users/999",
1279
+ "path_params": {
1280
+ "id": "999"
1281
+ },
1282
+ "query_params": {},
1283
+ "headers": {
1284
+ "Authorization": "Bearer {{token}}",
1285
+ "Accept": "application/json"
1286
+ },
1287
+ "body": null,
1288
+ "content_type": null,
1289
+ "response_status": 404,
1290
+ "source": {
1291
+ "test": "returns not found for an unknown user",
1292
+ "suite": "Users",
1293
+ "file": "./spec/requests/users_spec.rb",
1294
+ "line": 21
1295
+ }
1296
+ }
1297
+ ],
1298
+ "response_examples": [
1299
+ {
1300
+ "name": "Shows User",
1301
+ "status": 200,
1302
+ "headers": {
1303
+ "content-type": "application/json; charset=utf-8"
1304
+ },
1305
+ "body": {
1306
+ "id": 1,
1307
+ "name": "John Doe",
1308
+ "email": "john@example.com"
1309
+ },
1310
+ "content_type": "application/json",
1311
+ "source": {
1312
+ "test": "shows user",
1313
+ "suite": "Users",
1314
+ "file": "./spec/requests/users_spec.rb",
1315
+ "line": 15
1316
+ }
1317
+ },
1318
+ {
1319
+ "name": "Returns Not Found For An Unknown User",
1320
+ "status": 404,
1321
+ "headers": {
1322
+ "content-type": "application/json; charset=utf-8"
1323
+ },
1324
+ "body": {
1325
+ "error": "Not Found"
1326
+ },
1327
+ "content_type": "application/json",
1328
+ "source": {
1329
+ "test": "returns not found for an unknown user",
1330
+ "suite": "Users",
1331
+ "file": "./spec/requests/users_spec.rb",
1332
+ "line": 21
1333
+ }
1334
+ }
1335
+ ]
1336
+ },
1337
+ {
1338
+ "name": "Complete Task",
1339
+ "method": "POST",
1340
+ "path": "/api/v1/tasks/:id/complete",
1341
+ "controller": "api/v1/tasks",
1342
+ "action": "complete",
1343
+ "resource": "tasks",
1344
+ "api_version": "v1",
1345
+ "route_name": "complete_api_v1_task",
1346
+ "also_methods": [],
1347
+ "path_params": [
1348
+ "id"
1349
+ ],
1350
+ "parameters": {
1351
+ "path": [
1352
+ {
1353
+ "path": "id",
1354
+ "type": "string",
1355
+ "required": true,
1356
+ "values": [
1357
+ "1"
1358
+ ]
1359
+ }
1360
+ ],
1361
+ "query": [],
1362
+ "body": []
1363
+ },
1364
+ "responses": [
1365
+ {
1366
+ "status": 200,
1367
+ "schema": [
1368
+ {
1369
+ "path": "id",
1370
+ "type": "integer",
1371
+ "required": true,
1372
+ "values": [
1373
+ 1
1374
+ ]
1375
+ },
1376
+ {
1377
+ "path": "title",
1378
+ "type": "string",
1379
+ "required": true,
1380
+ "values": [
1381
+ "Write the docs"
1382
+ ]
1383
+ },
1384
+ {
1385
+ "path": "status",
1386
+ "type": "string",
1387
+ "required": true,
1388
+ "values": [
1389
+ "done"
1390
+ ]
1391
+ },
1392
+ {
1393
+ "path": "priority",
1394
+ "type": "string",
1395
+ "required": true,
1396
+ "values": [
1397
+ "high"
1398
+ ]
1399
+ }
1400
+ ],
1401
+ "example": {
1402
+ "id": 1,
1403
+ "title": "Write the docs",
1404
+ "status": "done",
1405
+ "priority": "high"
1406
+ },
1407
+ "headers": {
1408
+ "content-type": "application/json; charset=utf-8"
1409
+ },
1410
+ "content_type": "application/json"
1411
+ }
1412
+ ],
1413
+ "request_examples": [
1414
+ {
1415
+ "name": "Completes A Task",
1416
+ "method": "POST",
1417
+ "path": "/api/v1/tasks/1/complete",
1418
+ "path_params": {
1419
+ "id": "1"
1420
+ },
1421
+ "query_params": {},
1422
+ "headers": {
1423
+ "Accept": "application/json"
1424
+ },
1425
+ "body": null,
1426
+ "content_type": null,
1427
+ "response_status": 200,
1428
+ "source": {
1429
+ "test": "completes a task",
1430
+ "suite": "Tasks",
1431
+ "file": "./spec/requests/tasks_spec.rb",
1432
+ "line": 67
1433
+ }
1434
+ }
1435
+ ],
1436
+ "response_examples": [
1437
+ {
1438
+ "name": "Completes A Task",
1439
+ "status": 200,
1440
+ "headers": {
1441
+ "content-type": "application/json; charset=utf-8"
1442
+ },
1443
+ "body": {
1444
+ "id": 1,
1445
+ "title": "Write the docs",
1446
+ "status": "done",
1447
+ "priority": "high"
1448
+ },
1449
+ "content_type": "application/json",
1450
+ "source": {
1451
+ "test": "completes a task",
1452
+ "suite": "Tasks",
1453
+ "file": "./spec/requests/tasks_spec.rb",
1454
+ "line": 67
1455
+ }
1456
+ }
1457
+ ]
1458
+ },
1459
+ {
1460
+ "name": "List Tasks",
1461
+ "method": "GET",
1462
+ "path": "/api/v1/tasks",
1463
+ "controller": "api/v1/tasks",
1464
+ "action": "index",
1465
+ "resource": "tasks",
1466
+ "api_version": "v1",
1467
+ "route_name": "api_v1_tasks",
1468
+ "also_methods": [],
1469
+ "path_params": [],
1470
+ "parameters": {
1471
+ "path": [],
1472
+ "query": [
1473
+ {
1474
+ "path": "status",
1475
+ "type": "string",
1476
+ "required": false,
1477
+ "values": [
1478
+ "done",
1479
+ "open"
1480
+ ]
1481
+ }
1482
+ ],
1483
+ "body": []
1484
+ },
1485
+ "responses": [
1486
+ {
1487
+ "status": 200,
1488
+ "schema": [
1489
+ {
1490
+ "path": "[].id",
1491
+ "type": "integer",
1492
+ "required": true,
1493
+ "values": [
1494
+ 2,
1495
+ 3
1496
+ ]
1497
+ },
1498
+ {
1499
+ "path": "[].title",
1500
+ "type": "string",
1501
+ "required": true,
1502
+ "values": [
1503
+ "Ship 0.1.1",
1504
+ "Tidy the backlog"
1505
+ ]
1506
+ },
1507
+ {
1508
+ "path": "[].status",
1509
+ "type": "string",
1510
+ "required": true,
1511
+ "values": [
1512
+ "done",
1513
+ "open"
1514
+ ]
1515
+ },
1516
+ {
1517
+ "path": "[].priority",
1518
+ "type": "string",
1519
+ "required": true,
1520
+ "values": [
1521
+ "high",
1522
+ "low"
1523
+ ]
1524
+ }
1525
+ ],
1526
+ "example": [
1527
+ {
1528
+ "id": 1,
1529
+ "title": "Write the docs",
1530
+ "status": "open",
1531
+ "priority": "high"
1532
+ },
1533
+ {
1534
+ "id": 2,
1535
+ "title": "Ship 0.1.1",
1536
+ "status": "done",
1537
+ "priority": "high"
1538
+ },
1539
+ {
1540
+ "id": 3,
1541
+ "title": "Tidy the backlog",
1542
+ "status": "open",
1543
+ "priority": "low"
1544
+ }
1545
+ ],
1546
+ "headers": {
1547
+ "content-type": "application/json; charset=utf-8"
1548
+ },
1549
+ "content_type": "application/json"
1550
+ }
1551
+ ],
1552
+ "request_examples": [
1553
+ {
1554
+ "name": "Lists Tasks",
1555
+ "method": "GET",
1556
+ "path": "/api/v1/tasks",
1557
+ "path_params": {},
1558
+ "query_params": {},
1559
+ "headers": {
1560
+ "Accept": "application/json"
1561
+ },
1562
+ "body": null,
1563
+ "content_type": null,
1564
+ "response_status": 200,
1565
+ "source": {
1566
+ "test": "lists tasks",
1567
+ "suite": "Tasks",
1568
+ "file": "./spec/requests/tasks_spec.rb",
1569
+ "line": 7
1570
+ }
1571
+ },
1572
+ {
1573
+ "name": "Lists Open Tasks",
1574
+ "method": "GET",
1575
+ "path": "/api/v1/tasks",
1576
+ "path_params": {},
1577
+ "query_params": {
1578
+ "status": "open"
1579
+ },
1580
+ "headers": {
1581
+ "Accept": "application/json"
1582
+ },
1583
+ "body": null,
1584
+ "content_type": null,
1585
+ "response_status": 200,
1586
+ "source": {
1587
+ "test": "lists open tasks",
1588
+ "suite": "Tasks",
1589
+ "file": "./spec/requests/tasks_spec.rb",
1590
+ "line": 13
1591
+ }
1592
+ },
1593
+ {
1594
+ "name": "Lists Done Tasks",
1595
+ "method": "GET",
1596
+ "path": "/api/v1/tasks",
1597
+ "path_params": {},
1598
+ "query_params": {
1599
+ "status": "done"
1600
+ },
1601
+ "headers": {
1602
+ "Accept": "application/json"
1603
+ },
1604
+ "body": null,
1605
+ "content_type": null,
1606
+ "response_status": 200,
1607
+ "source": {
1608
+ "test": "lists done tasks",
1609
+ "suite": "Tasks",
1610
+ "file": "./spec/requests/tasks_spec.rb",
1611
+ "line": 19
1612
+ }
1613
+ }
1614
+ ],
1615
+ "response_examples": [
1616
+ {
1617
+ "name": "Lists Tasks",
1618
+ "status": 200,
1619
+ "headers": {
1620
+ "content-type": "application/json; charset=utf-8"
1621
+ },
1622
+ "body": [
1623
+ {
1624
+ "id": 1,
1625
+ "title": "Write the docs",
1626
+ "status": "open",
1627
+ "priority": "high"
1628
+ },
1629
+ {
1630
+ "id": 2,
1631
+ "title": "Ship 0.1.1",
1632
+ "status": "done",
1633
+ "priority": "high"
1634
+ },
1635
+ {
1636
+ "id": 3,
1637
+ "title": "Tidy the backlog",
1638
+ "status": "open",
1639
+ "priority": "low"
1640
+ }
1641
+ ],
1642
+ "content_type": "application/json",
1643
+ "source": {
1644
+ "test": "lists tasks",
1645
+ "suite": "Tasks",
1646
+ "file": "./spec/requests/tasks_spec.rb",
1647
+ "line": 7
1648
+ }
1649
+ },
1650
+ {
1651
+ "name": "Lists Open Tasks",
1652
+ "status": 200,
1653
+ "headers": {
1654
+ "content-type": "application/json; charset=utf-8"
1655
+ },
1656
+ "body": [
1657
+ {
1658
+ "id": 1,
1659
+ "title": "Write the docs",
1660
+ "status": "open",
1661
+ "priority": "high"
1662
+ },
1663
+ {
1664
+ "id": 3,
1665
+ "title": "Tidy the backlog",
1666
+ "status": "open",
1667
+ "priority": "low"
1668
+ }
1669
+ ],
1670
+ "content_type": "application/json",
1671
+ "source": {
1672
+ "test": "lists open tasks",
1673
+ "suite": "Tasks",
1674
+ "file": "./spec/requests/tasks_spec.rb",
1675
+ "line": 13
1676
+ }
1677
+ },
1678
+ {
1679
+ "name": "Lists Done Tasks",
1680
+ "status": 200,
1681
+ "headers": {
1682
+ "content-type": "application/json; charset=utf-8"
1683
+ },
1684
+ "body": [
1685
+ {
1686
+ "id": 2,
1687
+ "title": "Ship 0.1.1",
1688
+ "status": "done",
1689
+ "priority": "high"
1690
+ }
1691
+ ],
1692
+ "content_type": "application/json",
1693
+ "source": {
1694
+ "test": "lists done tasks",
1695
+ "suite": "Tasks",
1696
+ "file": "./spec/requests/tasks_spec.rb",
1697
+ "line": 19
1698
+ }
1699
+ }
1700
+ ]
1701
+ },
1702
+ {
1703
+ "name": "Create Task",
1704
+ "method": "POST",
1705
+ "path": "/api/v1/tasks",
1706
+ "controller": "api/v1/tasks",
1707
+ "action": "create",
1708
+ "resource": "tasks",
1709
+ "api_version": "v1",
1710
+ "route_name": null,
1711
+ "also_methods": [],
1712
+ "path_params": [],
1713
+ "parameters": {
1714
+ "path": [],
1715
+ "query": [],
1716
+ "body": [
1717
+ {
1718
+ "path": "task.title",
1719
+ "type": "string",
1720
+ "required": true,
1721
+ "values": [
1722
+ "Review the release",
1723
+ "Water the plants"
1724
+ ]
1725
+ },
1726
+ {
1727
+ "path": "task.priority",
1728
+ "type": "string",
1729
+ "required": true,
1730
+ "values": [
1731
+ "high",
1732
+ "low"
1733
+ ]
1734
+ }
1735
+ ]
1736
+ },
1737
+ "responses": [
1738
+ {
1739
+ "status": 201,
1740
+ "schema": [
1741
+ {
1742
+ "path": "id",
1743
+ "type": "integer",
1744
+ "required": true,
1745
+ "values": [
1746
+ 4
1747
+ ]
1748
+ },
1749
+ {
1750
+ "path": "status",
1751
+ "type": "string",
1752
+ "required": true,
1753
+ "values": [
1754
+ "open"
1755
+ ]
1756
+ },
1757
+ {
1758
+ "path": "title",
1759
+ "type": "string",
1760
+ "required": true,
1761
+ "values": [
1762
+ "Review the release",
1763
+ "Water the plants"
1764
+ ]
1765
+ },
1766
+ {
1767
+ "path": "priority",
1768
+ "type": "string",
1769
+ "required": true,
1770
+ "values": [
1771
+ "high",
1772
+ "low"
1773
+ ]
1774
+ }
1775
+ ],
1776
+ "example": {
1777
+ "id": 4,
1778
+ "status": "open",
1779
+ "title": "Review the release",
1780
+ "priority": "high"
1781
+ },
1782
+ "headers": {
1783
+ "content-type": "application/json; charset=utf-8"
1784
+ },
1785
+ "content_type": "application/json"
1786
+ },
1787
+ {
1788
+ "status": 422,
1789
+ "schema": [
1790
+ {
1791
+ "path": "errors.title[]",
1792
+ "type": "string",
1793
+ "required": false,
1794
+ "values": [
1795
+ "can't be blank"
1796
+ ]
1797
+ },
1798
+ {
1799
+ "path": "errors.priority[]",
1800
+ "type": "string",
1801
+ "required": false,
1802
+ "values": [
1803
+ "is not included in the list"
1804
+ ]
1805
+ }
1806
+ ],
1807
+ "example": {
1808
+ "errors": {
1809
+ "title": [
1810
+ "can't be blank"
1811
+ ]
1812
+ }
1813
+ },
1814
+ "headers": {
1815
+ "content-type": "application/json; charset=utf-8"
1816
+ },
1817
+ "content_type": "application/json"
1818
+ }
1819
+ ],
1820
+ "request_examples": [
1821
+ {
1822
+ "name": "Creates A High Priority Task",
1823
+ "method": "POST",
1824
+ "path": "/api/v1/tasks",
1825
+ "path_params": {},
1826
+ "query_params": {},
1827
+ "headers": {
1828
+ "Content-Type": "application/json",
1829
+ "Accept": "application/json"
1830
+ },
1831
+ "body": {
1832
+ "task": {
1833
+ "title": "Review the release",
1834
+ "priority": "high"
1835
+ }
1836
+ },
1837
+ "content_type": "application/json",
1838
+ "response_status": 201,
1839
+ "source": {
1840
+ "test": "creates a high priority task",
1841
+ "suite": "Tasks",
1842
+ "file": "./spec/requests/tasks_spec.rb",
1843
+ "line": 37
1844
+ }
1845
+ },
1846
+ {
1847
+ "name": "Creates A Low Priority Task",
1848
+ "method": "POST",
1849
+ "path": "/api/v1/tasks",
1850
+ "path_params": {},
1851
+ "query_params": {},
1852
+ "headers": {
1853
+ "Content-Type": "application/json",
1854
+ "Accept": "application/json"
1855
+ },
1856
+ "body": {
1857
+ "task": {
1858
+ "title": "Water the plants",
1859
+ "priority": "low"
1860
+ }
1861
+ },
1862
+ "content_type": "application/json",
1863
+ "response_status": 201,
1864
+ "source": {
1865
+ "test": "creates a low priority task",
1866
+ "suite": "Tasks",
1867
+ "file": "./spec/requests/tasks_spec.rb",
1868
+ "line": 43
1869
+ }
1870
+ },
1871
+ {
1872
+ "name": "Rejects A Task Without A Title",
1873
+ "method": "POST",
1874
+ "path": "/api/v1/tasks",
1875
+ "path_params": {},
1876
+ "query_params": {},
1877
+ "headers": {
1878
+ "Content-Type": "application/json",
1879
+ "Accept": "application/json"
1880
+ },
1881
+ "body": {
1882
+ "task": {
1883
+ "title": "",
1884
+ "priority": "high"
1885
+ }
1886
+ },
1887
+ "content_type": "application/json",
1888
+ "response_status": 422,
1889
+ "source": {
1890
+ "test": "rejects a task without a title",
1891
+ "suite": "Tasks",
1892
+ "file": "./spec/requests/tasks_spec.rb",
1893
+ "line": 49
1894
+ }
1895
+ },
1896
+ {
1897
+ "name": "Rejects An Unknown Priority",
1898
+ "method": "POST",
1899
+ "path": "/api/v1/tasks",
1900
+ "path_params": {},
1901
+ "query_params": {},
1902
+ "headers": {
1903
+ "Content-Type": "application/json",
1904
+ "Accept": "application/json"
1905
+ },
1906
+ "body": {
1907
+ "task": {
1908
+ "title": "Anything",
1909
+ "priority": "urgent"
1910
+ }
1911
+ },
1912
+ "content_type": "application/json",
1913
+ "response_status": 422,
1914
+ "source": {
1915
+ "test": "rejects an unknown priority",
1916
+ "suite": "Tasks",
1917
+ "file": "./spec/requests/tasks_spec.rb",
1918
+ "line": 55
1919
+ }
1920
+ }
1921
+ ],
1922
+ "response_examples": [
1923
+ {
1924
+ "name": "Creates A High Priority Task",
1925
+ "status": 201,
1926
+ "headers": {
1927
+ "content-type": "application/json; charset=utf-8"
1928
+ },
1929
+ "body": {
1930
+ "id": 4,
1931
+ "status": "open",
1932
+ "title": "Review the release",
1933
+ "priority": "high"
1934
+ },
1935
+ "content_type": "application/json",
1936
+ "source": {
1937
+ "test": "creates a high priority task",
1938
+ "suite": "Tasks",
1939
+ "file": "./spec/requests/tasks_spec.rb",
1940
+ "line": 37
1941
+ }
1942
+ },
1943
+ {
1944
+ "name": "Creates A Low Priority Task",
1945
+ "status": 201,
1946
+ "headers": {
1947
+ "content-type": "application/json; charset=utf-8"
1948
+ },
1949
+ "body": {
1950
+ "id": 4,
1951
+ "status": "open",
1952
+ "title": "Water the plants",
1953
+ "priority": "low"
1954
+ },
1955
+ "content_type": "application/json",
1956
+ "source": {
1957
+ "test": "creates a low priority task",
1958
+ "suite": "Tasks",
1959
+ "file": "./spec/requests/tasks_spec.rb",
1960
+ "line": 43
1961
+ }
1962
+ },
1963
+ {
1964
+ "name": "Rejects A Task Without A Title",
1965
+ "status": 422,
1966
+ "headers": {
1967
+ "content-type": "application/json; charset=utf-8"
1968
+ },
1969
+ "body": {
1970
+ "errors": {
1971
+ "title": [
1972
+ "can't be blank"
1973
+ ]
1974
+ }
1975
+ },
1976
+ "content_type": "application/json",
1977
+ "source": {
1978
+ "test": "rejects a task without a title",
1979
+ "suite": "Tasks",
1980
+ "file": "./spec/requests/tasks_spec.rb",
1981
+ "line": 49
1982
+ }
1983
+ },
1984
+ {
1985
+ "name": "Rejects An Unknown Priority",
1986
+ "status": 422,
1987
+ "headers": {
1988
+ "content-type": "application/json; charset=utf-8"
1989
+ },
1990
+ "body": {
1991
+ "errors": {
1992
+ "priority": [
1993
+ "is not included in the list"
1994
+ ]
1995
+ }
1996
+ },
1997
+ "content_type": "application/json",
1998
+ "source": {
1999
+ "test": "rejects an unknown priority",
2000
+ "suite": "Tasks",
2001
+ "file": "./spec/requests/tasks_spec.rb",
2002
+ "line": 55
2003
+ }
2004
+ }
2005
+ ]
2006
+ },
2007
+ {
2008
+ "name": "Get Task",
2009
+ "method": "GET",
2010
+ "path": "/api/v1/tasks/:id",
2011
+ "controller": "api/v1/tasks",
2012
+ "action": "show",
2013
+ "resource": "tasks",
2014
+ "api_version": "v1",
2015
+ "route_name": "api_v1_task",
2016
+ "also_methods": [],
2017
+ "path_params": [
2018
+ "id"
2019
+ ],
2020
+ "parameters": {
2021
+ "path": [
2022
+ {
2023
+ "path": "id",
2024
+ "type": "string",
2025
+ "required": true,
2026
+ "values": [
2027
+ "1"
2028
+ ]
2029
+ }
2030
+ ],
2031
+ "query": [],
2032
+ "body": []
2033
+ },
2034
+ "responses": [
2035
+ {
2036
+ "status": 200,
2037
+ "schema": [
2038
+ {
2039
+ "path": "id",
2040
+ "type": "integer",
2041
+ "required": true,
2042
+ "values": [
2043
+ 1
2044
+ ]
2045
+ },
2046
+ {
2047
+ "path": "title",
2048
+ "type": "string",
2049
+ "required": true,
2050
+ "values": [
2051
+ "Write the docs"
2052
+ ]
2053
+ },
2054
+ {
2055
+ "path": "status",
2056
+ "type": "string",
2057
+ "required": true,
2058
+ "values": [
2059
+ "open"
2060
+ ]
2061
+ },
2062
+ {
2063
+ "path": "priority",
2064
+ "type": "string",
2065
+ "required": true,
2066
+ "values": [
2067
+ "high"
2068
+ ]
2069
+ }
2070
+ ],
2071
+ "example": {
2072
+ "id": 1,
2073
+ "title": "Write the docs",
2074
+ "status": "open",
2075
+ "priority": "high"
2076
+ },
2077
+ "headers": {
2078
+ "content-type": "application/json; charset=utf-8"
2079
+ },
2080
+ "content_type": "application/json"
2081
+ },
2082
+ {
2083
+ "status": 404,
2084
+ "schema": [
2085
+ {
2086
+ "path": "error",
2087
+ "type": "string",
2088
+ "required": true,
2089
+ "values": [
2090
+ "Not Found"
2091
+ ]
2092
+ }
2093
+ ],
2094
+ "example": {
2095
+ "error": "Not Found"
2096
+ },
2097
+ "headers": {
2098
+ "content-type": "application/json; charset=utf-8"
2099
+ },
2100
+ "content_type": "application/json"
2101
+ }
2102
+ ],
2103
+ "request_examples": [
2104
+ {
2105
+ "name": "Shows A Task",
2106
+ "method": "GET",
2107
+ "path": "/api/v1/tasks/1",
2108
+ "path_params": {
2109
+ "id": "1"
2110
+ },
2111
+ "query_params": {},
2112
+ "headers": {
2113
+ "Accept": "application/json"
2114
+ },
2115
+ "body": null,
2116
+ "content_type": null,
2117
+ "response_status": 200,
2118
+ "source": {
2119
+ "test": "shows a task",
2120
+ "suite": "Tasks",
2121
+ "file": "./spec/requests/tasks_spec.rb",
2122
+ "line": 25
2123
+ }
2124
+ },
2125
+ {
2126
+ "name": "Returns Not Found For An Unknown Task",
2127
+ "method": "GET",
2128
+ "path": "/api/v1/tasks/999",
2129
+ "path_params": {
2130
+ "id": "999"
2131
+ },
2132
+ "query_params": {},
2133
+ "headers": {
2134
+ "Accept": "application/json"
2135
+ },
2136
+ "body": null,
2137
+ "content_type": null,
2138
+ "response_status": 404,
2139
+ "source": {
2140
+ "test": "returns not found for an unknown task",
2141
+ "suite": "Tasks",
2142
+ "file": "./spec/requests/tasks_spec.rb",
2143
+ "line": 31
2144
+ }
2145
+ }
2146
+ ],
2147
+ "response_examples": [
2148
+ {
2149
+ "name": "Shows A Task",
2150
+ "status": 200,
2151
+ "headers": {
2152
+ "content-type": "application/json; charset=utf-8"
2153
+ },
2154
+ "body": {
2155
+ "id": 1,
2156
+ "title": "Write the docs",
2157
+ "status": "open",
2158
+ "priority": "high"
2159
+ },
2160
+ "content_type": "application/json",
2161
+ "source": {
2162
+ "test": "shows a task",
2163
+ "suite": "Tasks",
2164
+ "file": "./spec/requests/tasks_spec.rb",
2165
+ "line": 25
2166
+ }
2167
+ },
2168
+ {
2169
+ "name": "Returns Not Found For An Unknown Task",
2170
+ "status": 404,
2171
+ "headers": {
2172
+ "content-type": "application/json; charset=utf-8"
2173
+ },
2174
+ "body": {
2175
+ "error": "Not Found"
2176
+ },
2177
+ "content_type": "application/json",
2178
+ "source": {
2179
+ "test": "returns not found for an unknown task",
2180
+ "suite": "Tasks",
2181
+ "file": "./spec/requests/tasks_spec.rb",
2182
+ "line": 31
2183
+ }
2184
+ }
2185
+ ]
2186
+ },
2187
+ {
2188
+ "name": "Update Task",
2189
+ "method": "PATCH",
2190
+ "path": "/api/v1/tasks/:id",
2191
+ "controller": "api/v1/tasks",
2192
+ "action": "update",
2193
+ "resource": "tasks",
2194
+ "api_version": "v1",
2195
+ "route_name": null,
2196
+ "also_methods": [
2197
+ "PUT"
2198
+ ],
2199
+ "path_params": [
2200
+ "id"
2201
+ ],
2202
+ "parameters": {
2203
+ "path": [
2204
+ {
2205
+ "path": "id",
2206
+ "type": "string",
2207
+ "required": true,
2208
+ "values": [
2209
+ "1"
2210
+ ]
2211
+ }
2212
+ ],
2213
+ "query": [],
2214
+ "body": [
2215
+ {
2216
+ "path": "task.title",
2217
+ "type": "string",
2218
+ "required": true,
2219
+ "values": [
2220
+ "Write better docs"
2221
+ ]
2222
+ }
2223
+ ]
2224
+ },
2225
+ "responses": [
2226
+ {
2227
+ "status": 200,
2228
+ "schema": [
2229
+ {
2230
+ "path": "id",
2231
+ "type": "integer",
2232
+ "required": true,
2233
+ "values": [
2234
+ 1
2235
+ ]
2236
+ },
2237
+ {
2238
+ "path": "title",
2239
+ "type": "string",
2240
+ "required": true,
2241
+ "values": [
2242
+ "Write better docs"
2243
+ ]
2244
+ },
2245
+ {
2246
+ "path": "status",
2247
+ "type": "string",
2248
+ "required": true,
2249
+ "values": [
2250
+ "open"
2251
+ ]
2252
+ },
2253
+ {
2254
+ "path": "priority",
2255
+ "type": "string",
2256
+ "required": true,
2257
+ "values": [
2258
+ "high"
2259
+ ]
2260
+ }
2261
+ ],
2262
+ "example": {
2263
+ "id": 1,
2264
+ "title": "Write better docs",
2265
+ "status": "open",
2266
+ "priority": "high"
2267
+ },
2268
+ "headers": {
2269
+ "content-type": "application/json; charset=utf-8"
2270
+ },
2271
+ "content_type": "application/json"
2272
+ }
2273
+ ],
2274
+ "request_examples": [
2275
+ {
2276
+ "name": "Updates A Task",
2277
+ "method": "PATCH",
2278
+ "path": "/api/v1/tasks/1",
2279
+ "path_params": {
2280
+ "id": "1"
2281
+ },
2282
+ "query_params": {},
2283
+ "headers": {
2284
+ "Content-Type": "application/json",
2285
+ "Accept": "application/json"
2286
+ },
2287
+ "body": {
2288
+ "task": {
2289
+ "title": "Write better docs"
2290
+ }
2291
+ },
2292
+ "content_type": "application/json",
2293
+ "response_status": 200,
2294
+ "source": {
2295
+ "test": "updates a task",
2296
+ "suite": "Tasks",
2297
+ "file": "./spec/requests/tasks_spec.rb",
2298
+ "line": 61
2299
+ }
2300
+ }
2301
+ ],
2302
+ "response_examples": [
2303
+ {
2304
+ "name": "Updates A Task",
2305
+ "status": 200,
2306
+ "headers": {
2307
+ "content-type": "application/json; charset=utf-8"
2308
+ },
2309
+ "body": {
2310
+ "id": 1,
2311
+ "title": "Write better docs",
2312
+ "status": "open",
2313
+ "priority": "high"
2314
+ },
2315
+ "content_type": "application/json",
2316
+ "source": {
2317
+ "test": "updates a task",
2318
+ "suite": "Tasks",
2319
+ "file": "./spec/requests/tasks_spec.rb",
2320
+ "line": 61
2321
+ }
2322
+ }
2323
+ ]
2324
+ },
2325
+ {
2326
+ "name": "Delete Task",
2327
+ "method": "DELETE",
2328
+ "path": "/api/v1/tasks/:id",
2329
+ "controller": "api/v1/tasks",
2330
+ "action": "destroy",
2331
+ "resource": "tasks",
2332
+ "api_version": "v1",
2333
+ "route_name": null,
2334
+ "also_methods": [],
2335
+ "path_params": [
2336
+ "id"
2337
+ ],
2338
+ "parameters": {
2339
+ "path": [
2340
+ {
2341
+ "path": "id",
2342
+ "type": "string",
2343
+ "required": true,
2344
+ "values": [
2345
+ "3"
2346
+ ]
2347
+ }
2348
+ ],
2349
+ "query": [],
2350
+ "body": []
2351
+ },
2352
+ "responses": [
2353
+ {
2354
+ "status": 204,
2355
+ "schema": [],
2356
+ "example": null,
2357
+ "headers": {},
2358
+ "content_type": null
2359
+ }
2360
+ ],
2361
+ "request_examples": [
2362
+ {
2363
+ "name": "Deletes A Task",
2364
+ "method": "DELETE",
2365
+ "path": "/api/v1/tasks/3",
2366
+ "path_params": {
2367
+ "id": "3"
2368
+ },
2369
+ "query_params": {},
2370
+ "headers": {
2371
+ "Accept": "application/json"
2372
+ },
2373
+ "body": null,
2374
+ "content_type": null,
2375
+ "response_status": 204,
2376
+ "source": {
2377
+ "test": "deletes a task",
2378
+ "suite": "Tasks",
2379
+ "file": "./spec/requests/tasks_spec.rb",
2380
+ "line": 73
2381
+ }
2382
+ }
2383
+ ],
2384
+ "response_examples": [
2385
+ {
2386
+ "name": "Deletes A Task",
2387
+ "status": 204,
2388
+ "headers": {},
2389
+ "body": null,
2390
+ "content_type": null,
2391
+ "source": {
2392
+ "test": "deletes a task",
2393
+ "suite": "Tasks",
2394
+ "file": "./spec/requests/tasks_spec.rb",
2395
+ "line": 73
2396
+ }
2397
+ }
2398
+ ]
2399
+ }
2400
+ ],
2401
+ "uncovered_routes": []
2402
+ }