zio.schema.annotation

Members list

Type members

Classlikes

final case class caseName(name: String) extends StaticAnnotation

Annotation for specifying an alternate identity for a case of an enum. Currently, the subtype name is always used.

Annotation for specifying an alternate identity for a case of an enum. Currently, the subtype name is always used.

This is the dual of @fieldName, but for sums rather than products.

Value parameters

name

The alternate name to use for the case.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Annotation
class Object
trait Matchable
class Any
Show all
final case class caseNameAliases(aliases: String*) extends StaticAnnotation

Annotation for specifying a list of aliases if the case name is somehow known by.

Annotation for specifying a list of aliases if the case name is somehow known by.

Value parameters

aliases

A variable-length sequence of Strings representing the aliases of the case.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Annotation
class Object
trait Matchable
class Any
Show all
final case class description(text: String) extends StaticAnnotation

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Annotation
class Object
trait Matchable
class Any
Show all
final case class directDynamicMapping() extends StaticAnnotation

When applied to a Schema.Dynamic schema, indicates that the dynamic value should be directly mapped to the target codec if possible.

When applied to a Schema.Dynamic schema, indicates that the dynamic value should be directly mapped to the target codec if possible.

For example the JSON codec can encode DynamicValue.Record to a JSON object directly instead of encoding the DynamicValue structure.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Annotation
class Object
trait Matchable
class Any
Show all
final case class discriminatorName(tag: String) extends StaticAnnotation

Annotation used to specify the name of a field that will be used to contain the id which identifies which term in an enum is being serialized / deserialized.

Annotation used to specify the name of a field that will be used to contain the id which identifies which term in an enum is being serialized / deserialized.

For example, if you set @discriminatorName("type"), then a field called "type" will be used to store the identity of the case of the enum that is being serialized / deserialized.

Value parameters

tag

the name of the field that will be used to store the identity of the case of the enum

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Annotation
class Object
trait Matchable
class Any
Show all
final case class fieldDefaultValue[A](value: A) extends StaticAnnotation

Annotation specifying the default value that should be utilized when the field is not present during deserialization. This is similar to @optionalField, except that the default value is user-defined rather than computed automatically using the field schema.

Annotation specifying the default value that should be utilized when the field is not present during deserialization. This is similar to @optionalField, except that the default value is user-defined rather than computed automatically using the field schema.

Value parameters

value

The default value to use for the field.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Annotation
class Object
trait Matchable
class Any
Show all
final case class fieldName(name: String) extends StaticAnnotation

Annotation for specifying an alternate identity for a field of a case class. Currently, the field name is always used. But sometimes, it can be convenient to have control over that name.

Annotation for specifying an alternate identity for a field of a case class. Currently, the field name is always used. But sometimes, it can be convenient to have control over that name.

For example, the API expects username to be stored as user_name, but inside the case class, the field is named username. Such an annotation, applied directly to the field, could indicate a different identity for the field than the field name itself.

Value parameters

name

The alternate name to use for the field.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Annotation
class Object
trait Matchable
class Any
Show all
final case class fieldNameAliases(aliases: String*) extends StaticAnnotation

Annotation for specifying a list of aliases if the field is somehow known by.

Annotation for specifying a list of aliases if the field is somehow known by.

Value parameters

aliases

A variable-length sequence of Strings representing the aliases of the field.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Annotation
class Object
trait Matchable
class Any
Show all
final case class noDiscriminator() extends StaticAnnotation

Indicates that an Enum should be encoded without any specific discriminator, relying on fallback on failure when decoding.

Indicates that an Enum should be encoded without any specific discriminator, relying on fallback on failure when decoding.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Annotation
class Object
trait Matchable
class Any
Show all
final case class optionalField() extends StaticAnnotation

Annotation specifying that deserialization should not fail even if a value of this type is not specified.

Annotation specifying that deserialization should not fail even if a value of this type is not specified.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Annotation
class Object
trait Matchable
class Any
Show all
final case class recordName(name: String) extends StaticAnnotation

Annotation for specifying an alternate name for a record.

Annotation for specifying an alternate name for a record.

Value parameters

name

The alternate name to use for the record.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Annotation
class Object
trait Matchable
class Any
Show all
final case class rejectExtraFields() extends StaticAnnotation

Annotation specifying that deserialization should reject payloads that contain more fields than specified.

Annotation specifying that deserialization should reject payloads that contain more fields than specified.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Annotation
class Object
trait Matchable
class Any
Show all
final case class simpleEnum(automaticallyAdded: Boolean) extends StaticAnnotation

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Annotation
class Object
trait Matchable
class Any
Show all
case class transientCase() extends StaticAnnotation

Annotation specifying that serialization should make no effort to encode the case to which the annotation is applied.

Annotation specifying that serialization should make no effort to encode the case to which the annotation is applied.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Annotation
class Object
trait Matchable
class Any
Show all
final case class transientField() extends StaticAnnotation

Annotation specifying that serialization should make no effort to encode the field to which the annotation is applied.

Annotation specifying that serialization should make no effort to encode the field to which the annotation is applied.

This is the dual of @optionalField.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Annotation
class Object
trait Matchable
class Any
Show all
final case class validate[A](validation: Validation[A]) extends StaticAnnotation

Attributes

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