Asn1OpenPolymorphicWithDefaultSerializer
open class Asn1OpenPolymorphicWithDefaultSerializer<T : Any>(val baseClass: KClass<T>, val defaultSerializer: KSerializer<T>) : KSerializer<T> (source)
Uses a contextual ASN.1 open-polymorphic serializer for baseClass when one is registered in the active DER instance, and defaultSerializer otherwise.
This is useful for extensible ASN.1 types that also have a structural fallback representation. Subclass it with an object usable from @Serializable(with = ...). It keeps an open-polymorphic descriptor, so callers can add semantic subtype mappings through the usual polymorphicByTag or polymorphicByOid DSL.