-
-
Notifications
You must be signed in to change notification settings - Fork 587
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
Fix serializing nulls in arrays #626
Conversation
5604cd8
to
0cef8ba
Compare
Also fixed yaml serialization for integrity and added some tests for serializing nulls |
Merging this as it is is not possible. As it is, is a BC break since the array serialization behavior changes between versions. What about adding an extra Other suggestions? Otherwise will have to postpone it to 2.0 |
Not sure that fixing bug should be considered a BC break |
valid point.... |
But there will be a lot of broken code around if this gets merged as it is |
The behaviour is inconsistent now. We have $array = [0, null, 'a'];
$context = SerializationContext::create()->setSerializeNull(true);
|
@megazoll what do you think? |
@scaytrase I agree with you, but Im just worried for all the users that upgrading from 1.3 to 1.4 get their code to be broken. |
@goetas updated the table. Currently json makes the array to be an object, yaml does not (simply ignores null as toArray). I think we should ask the community, i.e maintainers of some dependent libraries (FOS Rest, Sonata Admin) https://www.versioneye.com/php/jms:serializer/references |
IMO |
At the moment moving it to 1.5 Anybody interested in implementing something as #626 (comment) ? |
0cef8ba
to
d6fa267
Compare
@goetas updated. Please review my changes. |
null
s in the arrays should not be ignored when serializeNull istrue
.