JsonTransformingSerializer

constructor(tSerializer: KSerializer<T>)(source)

Parameters

T

A type for Kotlin property for which this serializer could be applied. Not the type that you may encounter in JSON. (e.g. if you unwrap a list to a single value T, use T, not List<T>)

tSerializer

A serializer for type T. Determines JsonElement which is passed to transformSerialize. Should be able to parse JsonElement from transformDeserialize function. Usually, default serializer is sufficient.