Skip to content
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

Handle correctly nested declared params #423

Merged
merged 2 commits into from
Jun 8, 2013

Conversation

jbarreneche
Copy link
Contributor

Hi,

the method declared from Grape::Endpoint wasn't handling correctly the case when there were grouped params

eg:

require 'grape'

class Test < Grape::API
  params do
    group :nested do
      requires :value
    end
  end
  get "/" do
    declared(params).inspect
  end
end

run Test

curl localhost:9292/\?nested\[value\]\=3

currently this returns {:value=>nil} instead of {:nested => { :value => 3 } }

Please let me know if you want me to change or add something

Thanks!!!

@dblock
Copy link
Member

dblock commented Jun 7, 2013

This looks solid. Could you please update CHANGELOG, too. Thx.

@dblock
Copy link
Member

dblock commented Jun 7, 2013

cc: @mbleigh in case I am missing something here ...

@dblock dblock merged commit 5c08c46 into ruby-grape:master Jun 8, 2013
@dblock
Copy link
Member

dblock commented Jun 8, 2013

Merged, thank you.

@jbarreneche
Copy link
Contributor Author

Thank you for the quick merge and for grape itself!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants