zio.schema.Schema
See theSchema companion object
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]
}
Attributes
- Companion:
- object
- Graph
- Supertypes
- Known subtypes
- class Set[A]class Dynamictrait Enum[Z]class Enum19[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, Z]class Enum20[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, Z]class Enum21[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, Z]class Enum22[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, Z]class Fail[A]class Lazy[A]class Optional[A]class Primitive[A]trait Record[R]trait CaseClass0[Z]trait CaseClass18[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, Z]trait CaseClass19[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, Z]trait CaseClass20[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, Z]trait CaseClass21[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, Z]trait CaseClass22[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, Z]class GenericRecord
- Self type
- Schema[A]