NonEmptySerializer

abstract class NonEmptySerializer<T : Any>(tSerializer: ERROR CLASS: Symbol not found for KSerializer<T>) : <ERROR CLASS> ERROR CLASS: Symbol not found for JsonTransformingSerializer<T>(source)

Replicates Jackson's @JsonInclude(JsonInclude.Include.NON_EMPTY) behaviour. Strips null, empty strings, empty arrays, and empty objects from the serialized output. Requires the enclosing Json instance to have encodeDefaults = true, which is already in our default global Json instance.

Usage:

Constructors

Link copied to clipboard
constructor(tSerializer: ERROR CLASS: Symbol not found for KSerializer<T>)

Functions

Link copied to clipboard
open override fun transformSerialize(element: ERROR CLASS: Symbol not found for JsonElement): ERROR CLASS: Symbol not found for JsonElement