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
When working with some specific class it's possible to annotate it with @JsonInclude(Include.NON_EMPTY) or also prepare own ObjectMapper implementation with Serializers which redefine isEmpty() method to apply even more sophisticated logic. Details described here FasterXML/jackson-databind#730
But it's tricky for me as well to ignore nulls when dealing with raw jsons (then Include strategy nor custom ObjectMapper doesn't do the job).
If the second one is the expected value, and you use LENIENT or STRICT_ORDER modes, then this will pass. However, if the first one (with age:null) is the expected value, it will fail because technically speaking, the field actually exists in the JSON tree. Therefore, this is WAI. You can try jmayday's advice, or write a scrubber utility to remove null fields before passing it to JSONAssert.
I would like to allow this:
to be equal to
The text was updated successfully, but these errors were encountered: