Class JsonConfig
- java.lang.Object
-
- io.quarkus.resteasy.reactive.kotlin.serialization.common.runtime.JsonConfig
-
public class JsonConfig extends Object
-
-
Field Summary
Fields Modifier and Type Field Description booleanallowSpecialFloatingPointValuesRemoves JSON specification restriction on special floating-point values such as `NaN` and `Infinity` and enables their serialization and deserialization.booleanallowStructuredMapKeysEnables 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]`.StringclassDiscriminatorName of the class descriptor property for polymorphic serialization.booleancoerceInputValuesEnables coercing incorrect JSON values to the default property value in the following cases: 1.booleandecodeEnumsCaseInsensitiveSpecifies if the enum values should be decoded case insensitively.booleanencodeDefaultsSpecifies whether default values of Kotlin properties should be encoded.booleanexplicitNullsSpecifies whether `null` values should be encoded for nullable properties and must be present in JSON object during decoding.booleanignoreUnknownKeysSpecifies whether encounters of unknown properties in the input JSON should be ignored instead of throwing [SerializationException].booleanisLenientRemoves JSON specification restriction (RFC-4627) and makes parser more liberal to the malformed input.Optional<String>namingStrategySpecifies theJsonNamingStrategythat should be used for all properties in classes for serialization and deserialization.booleanprettyPrintSpecifies whether resulting JSON should be pretty-printed.StringprettyPrintIndentSpecifies indent string to use with [prettyPrint] modebooleanuseAlternativeNamesSpecifies whether Json instance makes use of [JsonNames] annotation.booleanuseArrayPolymorphismSwitches polymorphic serialization to the default array format.
-
Constructor Summary
Constructors Constructor Description JsonConfig()
-
-
-
Field Detail
-
allowSpecialFloatingPointValues
@ConfigItem(defaultValue="false") public boolean allowSpecialFloatingPointValues
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.
-
allowStructuredMapKeys
@ConfigItem(defaultValue="false") public boolean allowStructuredMapKeys
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]`.
-
classDiscriminator
@ConfigItem(defaultValue="type") public String classDiscriminator
Name of the class descriptor property for polymorphic serialization.
-
coerceInputValues
@ConfigItem(defaultValue="false") public boolean coerceInputValues
Enables coercing incorrect JSON values to the default property value in the following cases: 1. JSON value is `null` but property type is non-nullable. 2. Property type is an enum type, but JSON value contains unknown enum member.
-
encodeDefaults
@ConfigItem(defaultValue="true") public boolean encodeDefaults
Specifies whether default values of Kotlin properties should be encoded.
-
explicitNulls
@ConfigItem(defaultValue="true") public boolean explicitNulls
Specifies whether `null` values should be encoded for nullable properties and must be present in JSON object during decoding.When this flag is disabled properties with `null` values without default are not encoded; during decoding, the absence of a field value is treated as `null` for nullable properties without a default value.
trueby default.
-
ignoreUnknownKeys
@ConfigItem(defaultValue="false") public boolean ignoreUnknownKeys
Specifies whether encounters of unknown properties in the input JSON should be ignored instead of throwing [SerializationException].
-
isLenient
@ConfigItem(defaultValue="false") public boolean isLenient
Removes JSON specification restriction (RFC-4627) and makes parser more liberal to the malformed input. In lenient mode quoted boolean literals, and unquoted string literals are allowed.Its relaxations can be expanded in the future, so that lenient parser becomes even more permissive to invalid value in the input, replacing them with defaults.
-
prettyPrint
@ConfigItem(defaultValue="false") public boolean prettyPrint
Specifies whether resulting JSON should be pretty-printed.
-
prettyPrintIndent
@ConfigItem(defaultValue=" ") public String prettyPrintIndent
Specifies indent string to use with [prettyPrint] mode
-
useAlternativeNames
@ConfigItem(defaultValue="true") public boolean useAlternativeNames
Specifies whether Json instance makes use of [JsonNames] annotation.Disabling this flag when one does not use [JsonNames] at all may sometimes result in better performance, particularly when a large count of fields is skipped with [ignoreUnknownKeys].
-
useArrayPolymorphism
@ConfigItem(defaultValue="false") public boolean useArrayPolymorphism
Switches polymorphic serialization to the default array format. This is an option for legacy JSON format and should not be generally used.
-
namingStrategy
@ConfigItem(name="naming-strategy") public Optional<String> namingStrategy
Specifies theJsonNamingStrategythat should be used for all properties in classes for serialization and deserialization. This strategy is applied for all entities that haveStructureKind.CLASS.nullby default.This element can be one of two things:
- the fully qualified class name of a type implements the
NamingStrategyinterface and has a no-arg constructor - a value in the form
NamingStrategy.SnakeCasewhich refers to built-in values provided by the kotlin serialization library itself.
- the fully qualified class name of a type implements the
-
decodeEnumsCaseInsensitive
@ConfigItem(defaultValue="false") public boolean decodeEnumsCaseInsensitive
Specifies if the enum values should be decoded case insensitively.
-
-