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
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@
9
9
10
10
#### Fixes
11
11
12
+
*[#1142](https://github.com/ruby-grape/grape/pull/1114): Makes #declared unavailable to before filters - [@jrforrest](https://github.com/jrforrest)
12
13
*[#1114](https://github.com/ruby-grape/grape/pull/1114): Fix regression which broke identical endpoints with different versions - [@suan](https://github.com/suan).
13
14
*[#1109](https://github.com/ruby-grape/grape/pull/1109): Memoize Virtus attribute and fix memory leak - [@marshall-lee](https://github.com/marshall-lee).
14
15
*[#1101](https://github.com/intridea/grape/pull/1101): Fix: Incorrect media-type `Accept` header now correctly returns 406 with `strict: true` - [@elliotlarson](https://github.com/elliotlarson).
Copy file name to clipboardExpand all lines: README.md
+4
Original file line number
Diff line number
Diff line change
@@ -534,6 +534,10 @@ The returned hash is a `Hashie::Mash` instance, allowing you to access parameter
534
534
declared(params).user == declared(params)["user"]
535
535
```
536
536
537
+
538
+
The `#declared` method is not available to `before` filters, as those are evaluated prior
539
+
to parameter coercion.
540
+
537
541
### Include missing
538
542
539
543
By default `declared(params)` includes parameters that have `nil` values. If you want to return only the parameters that are not `nil`, you can use the `include_missing` option. By default, `include_missing` is set to `true`. Consider the following API:
Copy file name to clipboardExpand all lines: UPGRADING.md
+6
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,12 @@ Upgrading Grape
3
3
4
4
### Upgrading to >= 0.13.1
5
5
6
+
#### Changes to availability of DSL methods in filters
7
+
8
+
The `#declared` method of the route DSL is no longer available in the `before` filter. Using `declared` in a `before` filter will now raise `Grape::DSL::InsideRoute::MethodNotYetAvailable`.
9
+
10
+
See [#1074](https://github.com/ruby-grape/grape/issues/1074) for discussion of the issue.
11
+
6
12
#### Changes to header versioning and invalid header version handling
7
13
8
14
Identical endpoints with different versions now work correctly. A regression introduced in Grape 0.11.0 caused all but the first-mounted version for such an endpoint to wrongly throw an `InvalidAcceptHeader`. As a side effect, requests with a correct vendor but invalid version can no longer be rescued from a `rescue_from` block.
0 commit comments