1.2.0 (2024-07-26)
Features Added
JsonArray
,JsonBoolean
,JsonElement
,JsonNull
,JsonNumber
,JsonObject
, andJsonString
have been added
to represent a JSON structure with an object-oriented approach.JsonElement
can be used to generically deserialize
JSON content and retain JSON typing information. All classes support serialization to JSON, either at the root or as
a portion of the overall JSON structure.- Convenience APIs have been added to
JsonSerializable
to support deserialization directly fromString
,byte[]
,
InputStream
, andReader
sources without needing to useJsonProviders
to create aJsonReader
instance and to
support serialization directly toString
,byte[]
,OutputStream
, andWriter
targets without needing to use
JsonProviders
to create aJsonWriter
instance. - Overloads to
JsonWriter
'swriteArray
,writeArrayField
,writeMap
andwriteMapField
methods have been added
that can control how null elements in the array or null key-value pair values are handled in serialization.
Bugs Fixed
- A bug was fixed in
JsonWriter
'swriteArray
,writeArrayField
,writeMap
, andwriteMapField
methods when handling
null element values or null key-value pair values in serialization. Previously, handling of null values was left to
theWriteValueCallback
supplied to the methods, and if the callback method being used skipped writing null values it
would result in JSON arrays dropping elements and an exception inMap
serialization. Now, null values are always
written in the basic overload and in the new overloads that acceptboolean skipNullElements
/boolean skipNullValues
,
null values are skipped if the corresponding boolean is set totrue
. The basic overload will have a difference in
JSON produced, but it will be the correct representation of the data.