DiscriminatorField

zio.json.JsonCodecConfiguration.SumTypeHandling.DiscriminatorField
final case class DiscriminatorField(name: String) extends SumTypeHandling

For sealed classes, will determine the name of the field for disambiguating classes.

The default is to not use a typehint field and instead have an object with a single key that is the class name. See WrapperWithClassNameField.

Note that using a discriminator is less performant, uses more memory, and may be prone to DOS attacks that are impossible with the default encoding. In addition, there is slightly less type safety when using custom product encoders (which must write an unenforced object type). Only use this option if you must model an externally defined schema.

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

Attributes

Definition Classes

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product