Skip to content

Added support for coercion to Set or Set[Other] #642

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

Closed
wants to merge 1 commit into from

Conversation

jordaaash
Copy link
Contributor

I like Virtus's support for coercion to Sets as seen here:
https://github.com/solnic/virtus#collection-member-coercions

They can be treated the same as Arrays in the case of nil, and changing line 42 from @option[0] to @option.first behaves the same for either.

I like Virtus's support for coercion to Sets as seen here:
https://github.com/solnic/virtus#collection-member-coercions

They can be treated the same as Arrays in the case of `nil`, and changing line 41 from `@option[0]` to `@option.first` behaves the same for either.
@dblock
Copy link
Member

dblock commented May 14, 2014

Looks good, however it needs tests, README and CHANGELOG updates.

@jordaaash
Copy link
Contributor Author

Awesome, I just wanted to run it by you first.

A related issue that has come up in my own use of Grape is wanting to run the CoerceValidator after or between other validators, rather than always running it first. I can file a separate issue/request for this if it makes more sense, but here's a gist to illustrate:

https://gist.github.com/jordansexton/260662acf75e66d9bf79

I like the idea of using validators to successively massage parameter values into the desired format, but I'm definitely new to Grape, so it's entirely possible I'm just approaching this wrong or duplicating an existing or preferred way of doing this, so please let me know what you think.

@dblock
Copy link
Member

dblock commented May 15, 2014

You should open a separate issue. It would be definitely useful functionality.

@dblock
Copy link
Member

dblock commented Jul 6, 2014

Bump.

@dblock
Copy link
Member

dblock commented Apr 20, 2015

Closed via #995.

@dblock dblock closed this Apr 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants