-
Notifications
You must be signed in to change notification settings - Fork 79
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
Handling null in Serializer #98
Comments
Hello, @stasivanov! Thanks for your report! |
@dimazen, I'm not sure I won't break anything else :) In addition, it would be great to leave the current logic, but add the logic to include null values to the resulting JSON as an optional way. Cause, sometimes it is really great to have it with current logic, but sometimes no. Thanks! |
Update will be rolled out tomorrow :) |
@stasivanov you can check out 1.2.2 tag! Available via Carthage as well as via CocoaPods! |
Serializer.m has
if (returnedValue)
at 49th line.The problem is that because of this all null values are not included in the output Dictionary, and that's why it cannot be used to fill another object correctly with Deserializer.
Also, sometimes I really need to serialize json to contain all keys even if they are null or empty.
I hope this is very clear, but anyway - for example, I have class User with
email
.user1
has email "test@mail.com". Now I create anotheruser2
as a full copy ofuser1
. Then I resetuser2
'semail
tonil
, and want to apply those changes touser1
by filling it with the representation got by serializinguser2
. And you know, this won't work as expected.In case this line was added because of some specific reasons, then, please add a possibility to ignore it by force, so it will be possible to get the full representation, and not only for filled properties.
The text was updated successfully, but these errors were encountered: