File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 374
374
```
375
375
376
376
Parameters can be nested using ` group ` or by calling ` requires ` or ` optional ` with a block.
377
+ With a block, ` group ` , ` requires ` and ` optional ` accept an additional option ` type ` which can
378
+ be either ` Array ` or ` Hash ` , and defaults to ` Array ` . Depending on the value, the nested
379
+ parameters will be treated either as values of a hash or as values of hashes in an array.
377
380
In the above example, this means ` params[:media][:url] ` is required along with ` params[:id] ` ,
378
381
and ` params[:audio][:format] ` is required only if ` params[:audio] ` is present.
379
382
Original file line number Diff line number Diff line change
1
+ # Upgrading
2
+
3
+ ## upgrading to 0.6.2
4
+
5
+ In grape <= 0.6.1, ` group ` , ` optional ` and ` requires ` with block accepted
6
+ either an Array or a Hash.
7
+
8
+ In grape 0.6.2, these have an additional ` type ` attribute which defaults
9
+ to ` Array ` . This means that without a ` type ` attribute, these nested parameters
10
+ will no longer accept a single hash, only an array (of hashes).
You can’t perform that action at this time.
0 commit comments