Class JsonConfig
java.lang.Object
io.quarkus.resteasy.reactive.kotlin.serialization.common.runtime.JsonConfig
-
Field Summary
FieldsModifier and TypeFieldDescriptionboolean
Removes JSON specification restriction on special floating-point values such as `NaN` and `Infinity` and enables their serialization and deserialization.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]`.boolean
Specifies if trailing comma is allowed.Name of the class descriptor property for polymorphic serialization.boolean
Enables coercing incorrect JSON values to the default property value in the following cases: 1.boolean
Specifies if the enum values should be decoded case insensitively.boolean
Specifies whether default values of Kotlin properties should be encoded.boolean
Specifies whether `null` values should be encoded for nullable properties and must be present in JSON object during decoding.boolean
Specifies whether encounters of unknown properties in the input JSON should be ignored instead of throwing [SerializationException].boolean
Removes JSON specification restriction (RFC-4627) and makes parser more liberal to the malformed input.Specifies theJsonNamingStrategy
that should be used for all properties in classes for serialization and deserialization.boolean
Specifies whether resulting JSON should be pretty-printed.Specifies indent string to use with [prettyPrint] modeboolean
Specifies whether Json instance makes use of [JsonNames] annotation.boolean
Switches polymorphic serialization to the default array format. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
allowSpecialFloatingPointValues
@ConfigItem(defaultValue="false") public boolean allowSpecialFloatingPointValuesRemoves 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 allowStructuredMapKeysEnables 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
Name of the class descriptor property for polymorphic serialization. -
coerceInputValues
@ConfigItem(defaultValue="false") public boolean coerceInputValuesEnables 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 encodeDefaultsSpecifies whether default values of Kotlin properties should be encoded. -
explicitNulls
@ConfigItem(defaultValue="true") public boolean explicitNullsSpecifies 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.
true
by default. -
ignoreUnknownKeys
@ConfigItem(defaultValue="false") public boolean ignoreUnknownKeysSpecifies whether encounters of unknown properties in the input JSON should be ignored instead of throwing [SerializationException]. -
isLenient
@ConfigItem(defaultValue="false") public boolean isLenientRemoves 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 prettyPrintSpecifies whether resulting JSON should be pretty-printed. -
prettyPrintIndent
Specifies indent string to use with [prettyPrint] mode -
useAlternativeNames
@ConfigItem(defaultValue="true") public boolean useAlternativeNamesSpecifies 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 useArrayPolymorphismSwitches polymorphic serialization to the default array format. This is an option for legacy JSON format and should not be generally used. -
namingStrategy
Specifies theJsonNamingStrategy
that should be used for all properties in classes for serialization and deserialization. This strategy is applied for all entities that haveStructureKind.CLASS
.null
by default.This element can be one of two things:
- the fully qualified class name of a type implements the
NamingStrategy
interface and has a no-arg constructor - a value in the form
NamingStrategy.SnakeCase
which 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 decodeEnumsCaseInsensitiveSpecifies if the enum values should be decoded case insensitively. -
allowTrailingComma
@ConfigItem(defaultValue="false") public boolean allowTrailingCommaSpecifies if trailing comma is allowed.
-
-
Constructor Details
-
JsonConfig
public JsonConfig()
-
-
Method Details