JsonBuilder
Builder of the Json instance provided by Json { ... }
factory function.
Properties
Removes JSON specification restriction on special floating-point values such as NaN
and Infinity
and enables their serialization and deserialization. When enabling it, please ensure that the receiving party will be able to encode and decode these special values. false
by default.
Enables structured objects to be serialized as map keys by changing serialized form of the map from JSON object (key-value pairs) to flat array like [k1, v1, k2, v2]
. false
by default.
Name of the class descriptor property for polymorphic serialization. "type" by default.
Enables coercing incorrect JSON values to the default property value in the following cases:
Enables decoding enum values in a case-insensitive manner. Encoding is not affected.
Specifies whether default values of Kotlin properties should be encoded. false
by default.
Specifies whether null
values should be encoded for nullable properties and must be present in JSON object during decoding.
Specifies whether encounters of unknown properties in the input JSON should be ignored instead of throwing SerializationException. false
by default.
Specifies JsonNamingStrategy that should be used for all properties in classes for serialization and deserialization.
Specifies whether resulting JSON should be pretty-printed. false
by default.
Specifies indent string to use with prettyPrint mode 4 spaces by default. Experimentality note: this API is experimental because it is not clear whether this option has compelling use-cases.
Module with contextual and polymorphic serializers to be used in the resulting Json instance.
Specifies whether Json instance makes use of JsonNames annotation.
Switches polymorphic serialization to the default array format. This is an option for legacy JSON format and should not be generally used. false
by default.