Skip to content

Use Builder for JSON Deserialization

Eclipse Webmaster requested to merge github/fork/dbluhm/json-builder into next

Created by: dbluhm

I found that the previous @JsonCreator method had some flaws in practice. For instance, if your JSON you're deserializing from omits any of the default fields of DataElements, deserialization would fail due to @NonNull being used. Removing that, you get nulls instead of the defaults declared on the DataElement.

Using the Builder form here, we get to use sparse JSON and have the defaults placed correctly when using sparse JSON.

Merge request reports

Loading