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

Don't coerce nil for collection attributes when required is false #354

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mherold
Copy link

@mherold mherold commented Mar 1, 2016

Without this fix, collection attributes can never be set to nil when
coercion is enabled (because the coercer coerces nil to an empty array).

This should fix #334.

I originally suggested a change in a more central location, see this comment, but looking at the specs it seemed more appropriate to make this change only for collection attributes.

forest added a commit to ProductPlan/tracker_api that referenced this pull request Mar 18, 2016
Update this code when this is merged in Virtus.

 * Don't coerce nil for collection attributes when required is false
 * solnic/virtus#354
@forest
Copy link

forest commented Apr 4, 2016

👍

Repository owner locked and limited conversation to collaborators Apr 5, 2016
Without this fix, collection attributes can never be set to nil when
coercion is enabled (because the coercer coerces nil to an empty array).
@mherold mherold force-pushed the fix-collection-nil-coercion branch from f391d1f to 5701901 Compare August 10, 2021 13:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Distinguish empty arrays from an unset attribute
2 participants