Key
zio.blocks.schema.json.DiscriminatorKind.Key
case object Key extends DiscriminatorKind
Represents a discriminator strategy where the subtype identifier is encoded as the key of a JSON object.
It is a default strategy for serializing and deserializing of all kinds of variants (sealed hierarchies, union types, etc.).
In this strategy, the serialized representation of the subtype wraps the encoded value in a JSON object keyed by the subtype's discriminator, e.g., {"SubtypeIdentifier": {...}}.
This approach enables subtype differentiation based solely on the key of the JSON object for the sealed hierarchy.
Attributes
- Source
- DiscriminatorKind.scala
- Graph
-
- Supertypes
-
trait Singletontrait Producttrait Mirrortrait Serializabletrait Producttrait Equalstrait DiscriminatorKindclass Objecttrait Matchableclass Any
- Self type
-
Key.type
Members list
In this article