ruby-grape / ruby-grape/grape

param as is not work

Open
#2,237 8 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug?
Dominant language
Ruby
Stars
10k
Forks
1.2k
Avg merge
14h 38m
Merged PRs (30d)
92

Description

params do
    optional :page_size, as: :per_page, type: Integer
end

params #=> {page_size: 10} not have per_page
declared(params) #=> {per_page: 10}

i upgrade from 1.31 to 1.6.0

@brynary @tmornini @ctennis @olleolleolle @bernd
How should I write? thanks

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the params block on Grape 1.6.0 and comparing it with 1.3.1, focusing on the different results from params and declared(params). Trace the parameter declaration and alias handling reached by those calls. Done means the intended behavior for as: :per_page is established and covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.