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

Do not repeat the same error messages #586

Merged
merged 3 commits into from
Mar 5, 2014
Merged

Conversation

kiela
Copy link
Contributor

@kiela kiela commented Feb 26, 2014

If you want to validate param if:

  • is an integer
  • is greater than 1

and you have in your code something similar to:

params do
  requires :years, type: Integer, desc: "number of years", regexp: /^([1-9]\d+)/
end

and request contains years set to 1 or -1 or foo, grape produces output with the same message twice:

years is invalid, years is invalid

This PR fixes this this behavior and makes grape to return the same error message only once.

@dblock
Copy link
Member

dblock commented Feb 27, 2014

Thanks. I know it's trivial, but this needs a test and an update to CHANGELOG, please.

@dblock
Copy link
Member

dblock commented Mar 5, 2014

Thanks, merging.

dblock added a commit that referenced this pull request Mar 5, 2014
Do not repeat the same error messages
@dblock dblock merged commit 0a1fe13 into ruby-grape:master Mar 5, 2014
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