Closed
Description
I have code similar to this:
params do
optional :button_link, type: String
given :button_link do
requires :button_text, type: String
end
end
post :something do
puts params.inspect
end
When I post to "something" with no params, everything is valid, but I see that params has:
params.inspect
=> {"button_text"=>nil}
When I change the params block to this:
params do
optional :button_link, type: String
given :button_link do#, :authenticated_button_link do
requires :button_text, type: String, allow_blank: false
end
end
I get a validation error (button_text is empty). Am I using given
incorrectly or is this a bug?