Skip to content

Latest commit

 

History

History
18 lines (15 loc) · 726 Bytes

ShowNullsInJson.md

File metadata and controls

18 lines (15 loc) · 726 Bytes

How to show nulls in verifyAsJson

By default, verifyAsJson method does not display fields with null values. To modify this behavior and display null fields, follow the example provided below.

Person person = new Person("Max", null, 1);
JsonApprovals.verifyAsJson(person, GsonBuilder::serializeNulls);

snippet source | anchor