jsonDiscriminator

final case class jsonDiscriminator(name: String) extends Annotation

If used on a sealed class, 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.

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.

trait Product
trait Equals
class Annotation
class Object
trait Matchable
class Any

Value members

Inherited methods

def productElementNames: Iterator[String]
Inherited from:
Product
def productIterator: Iterator[Any]
Inherited from:
Product