You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 another user2 as a full copy of user1. Then I reset user2's email to nil, and want to apply those changes to user1 by filling it with the representation got by serializing user2. 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.
Hello, @stasivanov! Thanks for your report!
I got your issue: null values don't get added into the resulting JSON. Let me take a closer look on it on today's evening. Also you can make a pull request :)
@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.
Activity
dimazen commentedon Jun 22, 2017
Hello, @stasivanov! Thanks for your report!
I got your issue: null values don't get added into the resulting JSON. Let me take a closer look on it on today's evening. Also you can make a pull request :)
stasivanov commentedon Jun 22, 2017
@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!
dimazen commentedon Jun 24, 2017
Update will be rolled out tomorrow :)
dimazen commentedon Jun 25, 2017
@stasivanov you can check out 1.2.2 tag!
Available via Carthage as well as via CocoaPods!