Skip to content

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 irphilli/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