Closed Lars-Sommer closed 1 year ago
Try to join the two @Json
annotations to just one, having both attributes side by side. Intention is to have just one annotation for the class level settings
@Json(ignoreNullMembers: true, caseStyle: CaseStyle.pascal)
Aaah, rookie mistake, I did not know that you could join the annotations.
Thanks 👍
I have a problem with the ignoreNullMembers annotation. As far as I understand, you can use this annotation if you would like to ignore null members or not existing json members of the json that is about to be deserialized.
I have two models, with the only difference being this annotation:
Now if I parse the exact same data where none if the properties are null, to each model, I would expect the same result. But this is not the case:
Every property in TestModel2 is empty strings (their default value).
I would like to use the ignoreNullMembers annotation, but of course also deserialization. So am I doing anything wrong?