Serializer

class Serializer<T>(elementSerializer: KSerializer<T>) : KSerializer<OptionalVariable<T>> (source)

Serializes a Value with elementSerializer and an Undefined as nothing at all, so that the field is absent from the encoded variables. Only encoders that tolerate an element encoding nothing support this (the tree encoder of kotlinx-serialization-json does, its streaming encoder does not). Decoding is not supported, as variables are only ever sent.

Constructors

Link copied to clipboard
constructor(elementSerializer: KSerializer<T>)

Properties

Link copied to clipboard
open override val descriptor: SerialDescriptor

Functions

Link copied to clipboard
open override fun deserialize(decoder: Decoder): OptionalVariable<T>
Link copied to clipboard
open override fun serialize(encoder: Encoder, value: OptionalVariable<T>)