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 raise an IncompatibleOptionValues For a couple of potentially valid use cases #1252

Merged
merged 1 commit into from
Jan 22, 2016
Merged

do not raise an IncompatibleOptionValues For a couple of potentially valid use cases #1252

merged 1 commit into from
Jan 22, 2016

Conversation

jeradphelps
Copy link
Contributor

I believe the following two params blocks should be valid:

# The default is the entire range of allowed values
params { optional :numbers, type: Array[Integer], values: 0..2, default: 0..2 }
# The default is a subset of the entire range of allowed values
subject.params { optional :numbers, type: Array[Integer], values: [0, 1, 2], default: [1, 0] }

The current implementation doesn't account for these use cases and raises Grape::Exceptions::IncompatibleOptionValues. This PR will allow the two cases above.

@dblock
Copy link
Member

dblock commented Jan 22, 2016

Looks good! 👍

dblock added a commit that referenced this pull request Jan 22, 2016
…-range

do not raise an IncompatibleOptionValues For a couple of potentially valid use cases
@dblock dblock merged commit fbf633d into ruby-grape:master Jan 22, 2016
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