-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Deprecates Grape's Extensions for ParamsBuilder in favor of build_with #2540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Adds params_builder.rb registration process Update README.md Update UPGRADING.md Add exceptions query_parsing.rb and unknown_params_builder.rb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this prevent one from defining their own ParamBuilder
? I am not sure anybody would have, but it's still a public interface. 🤔
No, anyone can define their own. I've just reused the same technique as parsers, error_formatters, etc ... |
This PR refactors
params_builder
by using the same technique asvalidators
,parsers
,error formatters
... etc which is registration with a symbolized short name. IMO, it makes sense to follow the same pattern like other components that we have and theregistration
part ease the customization.There are 3 ways to configure the
params_builder
:Grape.config.params_builder
build_with
insideparams
scopeThis PR is an hybrid meaning it does not remove the old way, its just deprecating it. Here are the deprecations:
build_with
orGrape.config.param_builder
Grape::Extensions::Hashie::Mash::ParamBuilder
See UPGRADING.md
This PR also adds
build_with
a the API level since including the extensions concerns are deprecated.