Add route params in declared params
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 10k
- Forks
- 1.2k
- Avg merge
- 14h 38m
- Merged PRs (30d)
- 92
Description
In my app i use rails like helper method permitted_params
def permitted_params
@permitted_params ||= declared(params, include_missing: false)
end
But when i try to get route param id, declared param id had not been given and i forced to use params method
task = Task.find_by(id: params[:id])
I wrote the test, which checks declared params for route params
https://github.com/artem-russkikh/grape/blob/add-route-param-to-declared/spec/grape/route_param_to_declared_spec.rb
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the issue's linked spec, spec/grape/route_param_to_declared_spec.rb, and run that focused test. Trace how declared(params, include_missing: false) handles request values, then make route parameter IDs available through declared params and ensure the spec passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- api
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100