A Schema[A]
describes the structure of some data type A
, in terms of case classes,
enumerations (sealed traits), collections, and various primitive types (including not only
Scala's own primitive types, but enhanced with java.time and big integers / decimals).
Schemas models the structure of data types as first class values, so they can be introspected, transformed, and combined using ordinary Scala code, without macros, metaprogramming, or codegen.
There are implicit schemas provided for all standard Scala types, and you can automatically
derive schemas for your own data types by using DeriveSchema.gen[A]
. Whether you write them
by hand by using constructors and operators,
final case class Person(name: String, age: Int)
object Person {
implicit val personSchema: Schema[Person] = DeriveSchema.gen[Person]
}
- Companion:
- object
Type members
Types
Value members
Abstract methods
Returns a new schema that with annotation
Returns a new schema that with annotation
Returns a new schema that with annotation
Returns a new schema that with annotation
Returns a new schema that with annotation
Returns a new schema that with annotation
Returns a new schema that with annotation
Returns a new schema that with annotation
Returns a new schema that with annotation
Returns a new schema that with annotation
The default value for a Schema
of type A
.
The default value for a Schema
of type A
.
The default value for a Schema
of type A
.
The default value for a Schema
of type A
.
The default value for a Schema
of type A
.
The default value for a Schema
of type A
.
The default value for a Schema
of type A
.
The default value for a Schema
of type A
.
The default value for a Schema
of type A
.
The default value for a Schema
of type A
.
Concrete methods
A symbolic operator for orElseEither.
A symbolic operator for orElseEither.
A symbolic operator for orElseEither.
A symbolic operator for orElseEither.
A symbolic operator for orElseEither.
A symbolic operator for orElseEither.
Convert to Schema[B] iff B and A are homomorphic.
Convert to Schema[B] iff B and A are homomorphic.
This can be used to e.g convert between a case class and it's "generic" representation as a ListMap[String,_]
Convert to Schema[B] iff B and A are homomorphic.
Convert to Schema[B] iff B and A are homomorphic.
This can be used to e.g convert between a case class and it's "generic" representation as a ListMap[String,_]
Convert to Schema[B] iff B and A are homomorphic.
Convert to Schema[B] iff B and A are homomorphic.
This can be used to e.g convert between a case class and it's "generic" representation as a ListMap[String,_]
Convert to Schema[B] iff B and A are homomorphic.
Convert to Schema[B] iff B and A are homomorphic.
This can be used to e.g convert between a case class and it's "generic" representation as a ListMap[String,_]
Convert to Schema[B] iff B and A are homomorphic.
Convert to Schema[B] iff B and A are homomorphic.
This can be used to e.g convert between a case class and it's "generic" representation as a ListMap[String,_]
Convert to Schema[B] iff B and A are homomorphic.
Convert to Schema[B] iff B and A are homomorphic.
This can be used to e.g convert between a case class and it's "generic" representation as a ListMap[String,_]
Performs a diff between thisValue and thatValue. See zio.schema.Differ for details on the default diff algorithms.
Performs a diff between thisValue and thatValue. See zio.schema.Differ for details on the default diff algorithms.
Performs a diff between thisValue and thatValue. See zio.schema.Differ for details on the default diff algorithms.
Performs a diff between thisValue and thatValue. See zio.schema.Differ for details on the default diff algorithms.
Performs a diff between thisValue and thatValue. See zio.schema.Differ for details on the default diff algorithms.
Performs a diff between thisValue and thatValue. See zio.schema.Differ for details on the default diff algorithms.
Performs a diff between thisValue and thatValue. See zio.schema.Differ for details on the default diff algorithms.
Performs a diff between thisValue and thatValue. See zio.schema.Differ for details on the default diff algorithms.
Performs a diff between thisValue and thatValue. See zio.schema.Differ for details on the default diff algorithms.
Performs a diff between thisValue and thatValue. See zio.schema.Differ for details on the default diff algorithms.
Performs a diff between thisValue and thatValue. See zio.schema.Differ for details on the default diff algorithms.
Performs a diff between thisValue and thatValue. See zio.schema.Differ for details on the default diff algorithms.
Generate a homomorphism from A to B iff A and B are homomorphic
Generate a homomorphism from A to B iff A and B are homomorphic
Generate a homomorphism from A to B iff A and B are homomorphic
Generate a homomorphism from A to B iff A and B are homomorphic
Generate a homomorphism from A to B iff A and B are homomorphic
Generate a homomorphism from A to B iff A and B are homomorphic
Generate a homomorphism from A to B iff A and B are homomorphic
Generate a homomorphism from A to B iff A and B are homomorphic
Generate a homomorphism from A to B iff A and B are homomorphic
Generate a homomorphism from A to B iff A and B are homomorphic
Generate a homomorphism from A to B iff A and B are homomorphic
Generate a homomorphism from A to B iff A and B are homomorphic
Returns a new schema that modifies the type produced by this schema to be optional.
Returns a new schema that modifies the type produced by this schema to be optional.
Returns a new schema that modifies the type produced by this schema to be optional.
Returns a new schema that modifies the type produced by this schema to be optional.
Returns a new schema that modifies the type produced by this schema to be optional.
Returns a new schema that modifies the type produced by this schema to be optional.
Returns a new schema that modifies the type produced by this schema to be optional.
Returns a new schema that modifies the type produced by this schema to be optional.
Returns a new schema that modifies the type produced by this schema to be optional.
Returns a new schema that modifies the type produced by this schema to be optional.
Returns a new schema that modifies the type produced by this schema to be optional.
Returns a new schema that modifies the type produced by this schema to be optional.
Returns a new schema that combines this schema and the specified schema together, modeling their either composition.
Returns a new schema that combines this schema and the specified schema together, modeling their either composition.
Returns a new schema that combines this schema and the specified schema together, modeling their either composition.
Returns a new schema that combines this schema and the specified schema together, modeling their either composition.
Returns a new schema that combines this schema and the specified schema together, modeling their either composition.
Returns a new schema that combines this schema and the specified schema together, modeling their either composition.
Returns a new schema that combines this schema and the specified schema together, modeling their either composition.
Returns a new schema that combines this schema and the specified schema together, modeling their either composition.
Returns a new schema that combines this schema and the specified schema together, modeling their either composition.
Returns a new schema that combines this schema and the specified schema together, modeling their either composition.
Returns a new schema that combines this schema and the specified schema together, modeling their either composition.
Returns a new schema that combines this schema and the specified schema together, modeling their either composition.
Transforms this Schema[A]
into a Schema[B]
, by supplying two functions that can transform
between A
and B
, without possibility of failure.
Transforms this Schema[A]
into a Schema[B]
, by supplying two functions that can transform
between A
and B
, without possibility of failure.
Transforms this Schema[A]
into a Schema[B]
, by supplying two functions that can transform
between A
and B
, without possibility of failure.
Transforms this Schema[A]
into a Schema[B]
, by supplying two functions that can transform
between A
and B
, without possibility of failure.
Transforms this Schema[A]
into a Schema[B]
, by supplying two functions that can transform
between A
and B
, without possibility of failure.
Transforms this Schema[A]
into a Schema[B]
, by supplying two functions that can transform
between A
and B
, without possibility of failure.
Transforms this Schema[A]
into a Schema[B]
, by supplying two functions that can transform
between A
and B
, without possibility of failure.
Transforms this Schema[A]
into a Schema[B]
, by supplying two functions that can transform
between A
and B
, without possibility of failure.
Transforms this Schema[A]
into a Schema[B]
, by supplying two functions that can transform
between A
and B
, without possibility of failure.
Transforms this Schema[A]
into a Schema[B]
, by supplying two functions that can transform
between A
and B
, without possibility of failure.
Transforms this Schema[A]
into a Schema[B]
, by supplying two functions that can transform
between A
and B
, without possibility of failure.
Transforms this Schema[A]
into a Schema[B]
, by supplying two functions that can transform
between A
and B
, without possibility of failure.
Transforms this Schema[A]
into a Schema[B]
, by supplying two functions that can transform
between A
and B
(possibly failing in some cases).
Transforms this Schema[A]
into a Schema[B]
, by supplying two functions that can transform
between A
and B
(possibly failing in some cases).
Transforms this Schema[A]
into a Schema[B]
, by supplying two functions that can transform
between A
and B
(possibly failing in some cases).
Transforms this Schema[A]
into a Schema[B]
, by supplying two functions that can transform
between A
and B
(possibly failing in some cases).
Transforms this Schema[A]
into a Schema[B]
, by supplying two functions that can transform
between A
and B
(possibly failing in some cases).
Transforms this Schema[A]
into a Schema[B]
, by supplying two functions that can transform
between A
and B
(possibly failing in some cases).
Transforms this Schema[A]
into a Schema[B]
, by supplying two functions that can transform
between A
and B
(possibly failing in some cases).
Transforms this Schema[A]
into a Schema[B]
, by supplying two functions that can transform
between A
and B
(possibly failing in some cases).
Transforms this Schema[A]
into a Schema[B]
, by supplying two functions that can transform
between A
and B
(possibly failing in some cases).
Transforms this Schema[A]
into a Schema[B]
, by supplying two functions that can transform
between A
and B
(possibly failing in some cases).
Transforms this Schema[A]
into a Schema[B]
, by supplying two functions that can transform
between A
and B
(possibly failing in some cases).
Transforms this Schema[A]
into a Schema[B]
, by supplying two functions that can transform
between A
and B
(possibly failing in some cases).
Returns a new schema that combines this schema and the specified schema together, modeling their tuple composition.
Returns a new schema that combines this schema and the specified schema together, modeling their tuple composition.
Returns a new schema that combines this schema and the specified schema together, modeling their tuple composition.
Returns a new schema that combines this schema and the specified schema together, modeling their tuple composition.
Returns a new schema that combines this schema and the specified schema together, modeling their tuple composition.
Returns a new schema that combines this schema and the specified schema together, modeling their tuple composition.
Returns a new schema that combines this schema and the specified schema together, modeling their tuple composition.
Returns a new schema that combines this schema and the specified schema together, modeling their tuple composition.
Returns a new schema that combines this schema and the specified schema together, modeling their tuple composition.
Returns a new schema that combines this schema and the specified schema together, modeling their tuple composition.