-
Notifications
You must be signed in to change notification settings - Fork 183
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
What's the intended NULL value handling? #233
Comments
From what I recall, arrays don't check Array elements are generally not subject to the same level of scrutiny as object properties from my experience - see also #225 |
I'd happily accept a patch that extends the |
Just to rephrase:
Let's see if I can get there. |
The default setting is to be strict about NULL values if they are not allowed:
However there is one explicit test case in
ArrayTest.php
that verifies that NULL inside a JSON array of DateTime is translated to NULL in the final array:Every other test I have seen cares about null values to be either explicitly allowed, or the values are transformed into simple type values that match the required type:
One could argue that in the first case, the task is to keep the number of elements, and a side quest is to wrap the strings into
DateTime
objects if possible, and NULL would not be transferable into a usefulDateTime
object.I have not seen another test verifying that non-wrapping objects like
JsonMapperTest_Simple
are in fact allowing or denying NULL. If I extend the very first test inArrayTest.php
, the added NULL is put into the resulting array just the same:It looks like this is likely the reason for the influx in recent "complaints" about array elements being of unexpected type. And I think no matter how we'd fix it, it is a change in behavior that warrants a major version release.
Any insights from anyone?
Referencing #224 here for the same major release.
The text was updated successfully, but these errors were encountered: