RequestParametersFromSerializer

class RequestParametersFromSerializer<T : RequestParameters>(parameterSerializer: KSerializer<T>) : KSerializer<RequestParametersFrom<T>> (source)

In order to de-/serialize generic types we need a kind of factory approach. Because we deal with a sealed class we use an intermediary surrogate, keeping the generic parameters and the fields identifying the concrete RequestParametersFrom subtype.

During serialization, the subtype is flattened into that surrogate. During deserialization, the field combination determines the subtype again. DC API request metadata is represented directly on the surrogate, matching RequestParametersFrom.DcApiRequest. Plain JSON, JWS, and URI requests are selected from their respective fields. Missing RequestParametersFrom.RequestParametersSigned.verified values default to false; JwsFlattened is recognized but not implemented.

Constructors

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

Properties

Link copied to clipboard
open override val descriptor: SerialDescriptor

Functions

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