SumTypeHandling

zio.json.JsonCodecConfiguration.SumTypeHandling
See theSumTypeHandling companion trait

Attributes

Companion
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

final case class DiscriminatorField(name: String) extends SumTypeHandling

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

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

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

Use an object with a single key that is the class name.

Use an object with a single key that is the class name.

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type

Inherited and Abstract types

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror

The name of the type

The name of the type

Attributes

Inherited from:
Mirror