IdBsonSerializer

class IdBsonSerializer<T : Id<*>> : KSerializer<T>

Public Id serializer, to use explicitly when a contextual serializer is not supported by bson-kotlinx, typically for map keys:

@Serializable
data class Data(val map: Map<@Serializable(with = IdBsonSerializer::class) Id<Other>, String>)

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
open override val descriptor: SerialDescriptor

Functions

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