Field
zio.blocks.schema.json.DiscriminatorKind.Field
case class Field(name: String) extends DiscriminatorKind
Represents a discriminator strategy where a specific field in the JSON object is used to identify the subtype of a sealed hierarchy, e.g. {"type": "SubtypeIdentifier", ...}
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 JSON object.
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 JSON object. 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