JsonConfig

open class JsonConfig

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
@ConfigItem(defaultValue = "false")
open var allowSpecialFloatingPointValues: Boolean
Removes JSON specification restriction on special floating-point values such as `NaN` and `Infinity` and enables their serialization and deserialization.
Link copied to clipboard
@ConfigItem(defaultValue = "false")
open var allowStructuredMapKeys: Boolean
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]`.
Link copied to clipboard
@ConfigItem(defaultValue = "type")
open var classDiscriminator: String
Name of the class descriptor property for polymorphic serialization.
Link copied to clipboard
@ConfigItem(defaultValue = "false")
open var coerceInputValues: Boolean
Enables coercing incorrect JSON values to the default property value in the following cases: 1.
Link copied to clipboard
@ConfigItem(defaultValue = "true")
open var encodeDefaults: Boolean
Specifies whether default values of Kotlin properties should be encoded.
Link copied to clipboard
@ConfigItem(defaultValue = "true")
open var explicitNulls: Boolean
Specifies whether `null` values should be encoded for nullable properties and must be present in JSON object during decoding.
Link copied to clipboard
@ConfigItem(defaultValue = "false")
open var ignoreUnknownKeys: Boolean
Specifies whether encounters of unknown properties in the input JSON should be ignored instead of throwing [SerializationException].
Link copied to clipboard
@ConfigItem(defaultValue = "false")
open var isLenient: Boolean
Removes JSON specification restriction (RFC-4627) and makes parser more liberal to the malformed input.
Link copied to clipboard
@ConfigItem(name = "naming-strategy")
open var namingStrategy: Optional<String>
Specifies the JsonNamingStrategy that should be used for all properties in classes for serialization and deserialization.
Link copied to clipboard
@ConfigItem(defaultValue = "false")
open var prettyPrint: Boolean
Specifies whether resulting JSON should be pretty-printed.
Link copied to clipboard
@ConfigItem(defaultValue = " ")
open var prettyPrintIndent: String
Specifies indent string to use with [prettyPrint] mode
Link copied to clipboard
@ConfigItem(defaultValue = "true")
open var useAlternativeNames: Boolean
Specifies whether Json instance makes use of [JsonNames] annotation.
Link copied to clipboard
@ConfigItem(defaultValue = "false")
open var useArrayPolymorphism: Boolean
Switches polymorphic serialization to the default array format.

Functions

Link copied to clipboard
open fun toString(): String