-
-
Notifications
You must be signed in to change notification settings - Fork 586
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
Configure whether serializing empty array. #124
Comments
👍 |
Also there is any inconsistency in serializing arrays:
is serialized in JSON as empty array Whereas |
That seems like a bug. Are you sure this is the only difference? |
I haven't tried the deserialization but from serialization it seems to be the only difference. |
Currently works for the XML visitor
|
fixed in #757 |
The serializer currently allows to configure whether to serialize null values.
I think one more option is necessary: to configure whether to serialize empty arrays/strings. Otherwise it's a little incosistent that null values are not serialized but empty arrays are which is currently the case. But both basically mean the same: there is no information available.
So I'd suggest to add a method
setSerializeEmpty
which when passed false, will not serialize empty arrays (array()
) and empty strings (''
). So it does not have to do with the phpempty()
function because we want to serialize0
andfalse
.The text was updated successfully, but these errors were encountered: