Field
zio.blocks.schema.toon.DiscriminatorKind.Field
case class Field(name: String) extends DiscriminatorKind
Represents a discriminator strategy where a specific field in the TOON record is used to identify the subtype of a sealed hierarchy, e.g. $type: SubtypeIdentifier followed by the record fields.
Can be used only for serializing sealed hierarchy subtypes of non-abstract classes only (not union types).
Beware that parsing may be too slow for deeply nested or recursive data structures when the discriminator field is placed at the end of the TOON record.
Don't use it for untrusted input that should be parsed to deeply nested or recursive data structures to avoid potential security vulnerabilities of DoS/DoW attacks.
Value parameters
- name
-
The name of the discriminator field to be added to the TOON record. This field value will contain the subtype identifier as its value.
Attributes
- Source
- DiscriminatorKind.scala
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait DiscriminatorKindclass Objecttrait Matchableclass Any
Members list
In this article