What setting do I set to make the JsonElement deserializer use `null` rather than `JsonNull`?
m
What setting do I set to make the JsonElement deserializer use
null
rather than
JsonNull
?
c
You can’t. The only Json container types,
JsonObject
and
JsonArray
, both require children to be non-null
JsonElement
. Similarly, they can’t directly hold onto primitive values. Both
null
and primitive values are wrapped in
JsonPrimitive
(either
JsonLiteral
when a value exists, or
JsonNull
if it doesn’t)