ClassDiscriminator

annotation class ClassDiscriminator(val discriminator: String)(source)

Annotation to set the class discriminator of polymorphic base types.

Apply this to a polymorphic base type (such as an interface) to override the global class discriminator set in the ConfigBuilder object.

Properties

Link copied to clipboard

Class discriminator name to use for this base type. This value becomes effective for both serialization and deserialization. It is the caller's responsibility to ensure that the passed value is a single-line JSON5 string.