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
@@ -6,6 +6,7 @@
6
6
*[#2535](https://github.com/ruby-grape/grape/pull/2535): Delegates calls to inner objects - [@ericproulx](https://github.com/ericproulx).
7
7
*[#2537](https://github.com/ruby-grape/grape/pull/2537): Use activesupport `try` pattern - [@ericproulx](https://github.com/ericproulx).
8
8
*[#2536](https://github.com/ruby-grape/grape/pull/2536): Update normalize_path like Rails - [@ericproulx](https://github.com/ericproulx).
9
+
*[#2540](https://github.com/ruby-grape/grape/pull/2540): Introduce Params builder with symbolized short name - [@ericproulx](https://github.com/ericproulx).
@@ -803,16 +806,15 @@ The class can also be overridden on individual parameter blocks using `build_wit
803
806
804
807
```ruby
805
808
params do
806
-
build_with Grape::Extensions::Hash::ParamBuilder
809
+
build_with :hash
807
810
optional :color, type:String
808
811
end
809
812
```
810
813
811
-
Or globally with the [Configuration](#configuration)`Grape.configure.param_builder`.
812
-
813
814
In the example above, `params["color"]` will return `nil` since `params` is a plain `Hash`.
814
815
815
-
Available parameter builders are `Grape::Extensions::Hash::ParamBuilder`, `Grape::Extensions::ActiveSupport::HashWithIndifferentAccess::ParamBuilder` and `Grape::Extensions::Hashie::Mash::ParamBuilder`.
816
+
Available parameter builders are `:hash`, `:hash_with_indifferent_access`, and `:hashie_mash`.
Copy file name to clipboardExpand all lines: UPGRADING.md
+5
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,11 @@
1
1
Upgrading Grape
2
2
===============
3
3
4
+
#### Params Builder
5
+
6
+
- Passing a class to `build_with` or `Grape.config.param_builder` has been deprecated in favor of a symbolized short_name. See `SHORTNAME_LOOKUP` in [params_builder](lib/grape/params_builder.rb).
7
+
- Including Grape's extensions like `Grape::Extensions::Hashie::Mash::ParamBuilder` has been deprecated in favor of using `build_with` at the route level.
Grape.deprecator.warn'This concern has been deprecated. Use `build_with` with one of the following short_name (:hash, :hash_with_indifferent_access, :hashie_mash) instead.'
Grape.deprecator.warn'This concern has been deprecated. Use `build_with` with one of the following short_name (:hash, :hash_with_indifferent_access, :hashie_mash) instead.'
Grape.deprecator.warn'This concern has been deprecated. Use `build_with` with one of the following short_name (:hash, :hash_with_indifferent_access, :hashie_mash) instead.'
0 commit comments