All Projects → zio → zio-schema

zio / zio-schema

Licence: Apache-2.0 license
Compositional, type-safe schema definitions, which enable auto-derivation of codecs and migrations.

Programming Languages

scala
5932 projects
shell
77523 projects

ZIO-SCHEMA

Project Stage CI Release Issues Discord
Project stage CI Release Artifacts Average time to resolve an issue badge-discord

ZIO Schema is a ZIO-based library for modeling the schema of data structures as first-class values.

With schema descriptions that can be automatically derived for case classes and sealed traits, ZIO Schema provide powerful features for free:

  • Codecs for any supported protocol (JSON, protobuf, etc.), so data structures can be serialized and deserialized in a principled way
  • Diffing, patching, merging, and other generic-data-based operations
  • Migration of data structures from one schema to another compatible schema
  • Derivation of arbitrary type classes (Eq, Show, Ord, etc.) from the structure of the data

When your data structures need to be serialized, deserialized, persisted, or transported across the wire, then ZIO Schema lets you focus on data modeling and automatically tackle all the low-level, messy details for you.

ZIO Schema is used by a growing number of ZIO libraries, including ZIO Flow, ZIO Redis, ZIO Web, ZIO SQL and ZIO DynamoDB.

Installation

Add in your build.sbt:

libraryDependencies ++= Seq(
  "dev.zio" %% "zio-schema" % "<version>",
  // Required for automatic generic derivation of schemas
  "dev.zio" %% "zio-schema-derivation" % "<version>",
  "org.scala-lang" % "scala-reflect"  % scalaVersion.value % "provided"
)

Contributing

For the general guidelines, see ZIO contributor's guide.

TL;DR

Before you submit a PR, make sure your tests are passing, and that the code is properly formatted

sbt prepare

sbt test
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].