You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Address ruby-grape#543 - raise proper validation errors on array/hash types
* Also adds a :type option to group/requires/optional with block,
which can either be Array or Hash. It defaults to Array.
* Fixes (2) and (3) as mentioned in ruby-grape#543
* There is a quirk around query parameters: an empty array should
pass validation if the array itself is required, but with how
query parameters work, it doesn't. It does work fine with body
parameters using JSON or similar, which do have a concept of an
empty array.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@ Next Release
13
13
*[#531](https://github.com/intridea/grape/pull/531): Helpers are now available to auth middleware, executing in the context of the endpoint - [@joelvh](https://github.com/joelvh).
14
14
*[#540](https://github.com/intridea/grape/pull/540): Ruby 2.1.0 is now supported - [@salimane](https://github.com/salimane).
15
15
*[#544](https://github.com/intridea/grape/pull/544): `rescue_from` now handles subclasses of exceptions by default - [@xevix](https://github.com/xevix).
16
+
*[#545](https://github.com/intridea/grape/pull/545): Add `type` (Array or Hash) support to `requires`, `optional` and `group` with block and fix several validation issues around these - [@bwalex](https://github.com/bwalex).
last_response.body.should == '{"error":"admin[admin_name] is missing, admin[super][user][first_name] is missing"}'
123
+
last_response.body.should == '{"error":"admin[admin_name] is missing, admin[super][user] is missing, admin[super][user][first_name] is missing, admin[super][user][last_name] is missing"}'
0 commit comments