zio/zio-schema
53.8
Adequate · 7 November 2026
39.9k
lines of production code
Scala
primary language
4
measurements over time
What this system is
This system is the ZIO Schema library, a Scala toolkit for automatic schema derivation and data serialization. It provides codecs for converting data to and from multiple formats, including JSON, Avro, Protobuf, BSON, XML, Thrift, and MessagePack. The library supports cross-platform execution on JVM, Scala.js, and Scala Native, and includes utilities for schema validation, migration, and test data generation.
How it got here
2020–2021 — Initial release and core feature expansion
14 changes.
This period established the ZIO Schema library with initial scaffolding, cross-platform support, and a comprehensive suite of multi-format codecs. It introduced core capabilities for schema derivation, validation, diffing, and migration, while expanding the ecosystem with utilities for test data generation and optics derivation.
2022–2024 — multi-format codec expansion and derivation overhaul
18 changes.
This period focused on significantly expanding zio-schema's serialization capabilities by introducing codecs for Avro, BSON, MessagePack, and Thrift, alongside adding support for Scala.js and Scala Native. The core derivation system was also overhauled with a new \Deriver\ typeclass and caching mechanism to improve performance and extensibility across Scala 2 and 3. Comprehensive test suites were added to validate these new features and ensure robust platform-specific behavior.
2025–2026 — XML codec and Scala 3 test coverage
4 changes.
This period focused on introducing a new zero-dependency XML codec module for schema-based encoding and decoding, complete with streaming support and comprehensive configuration options. Concurrently, test coverage was expanded to include Scala 3-specific JSON codec features and IArray schema derivation, alongside extensive round-trip testing for the new XML codec against diverse real-world XML structures.
Features
Add BSON codec configuration and ObjectId support
The zio-schema-bson module now supports configuring the BSON codec via \BsonSchemaCodec.Config\, allowing users to customize sum-type handling (discriminator fields vs wrapper classes), class name mappings, and field name transformations. It also introduces a built-in \Schema\[ObjectId\]\ for seamless encoding and decoding of MongoDB ObjectIds, and adds comprehensive test coverage for generic types, configuration options, and mixed annotation scenarios.
zio-schema-bson · high confidence
Add JSON schema support for zio.json.ast.Json
The zio-schema-json module now includes a Schema for zio.json.ast.Json, enabling seamless serialization and deserialization of the Json abstract syntax tree. This new capability allows users to encode and decode dynamic JSON structures directly using zio-schema, supporting all standard JSON types (objects, arrays, strings, numbers, booleans, and null) and mapping them to DynamicValue representations.
zio-schema-json/shared/src/main · high confidence
Add JVM-specific schema support for URL and Currency types
This change introduces JVM-specific schema definitions for \java.net.URL\ and \java.util.Currency\. The \SchemaPlatformSpecific\ trait adds a schema for URLs that transforms to and from strings, handling validation errors gracefully. Additionally, \StandardType.scala\ defines a \CurrencyType\ standard type, including logic to retrieve the default currency from the system locale and handle cases where the locale is invalid or unset. These additions enable serialization and deserialization of these specific Java types on the JVM platform.
zio-schema/jvm · high confidence
Add Scala 2-specific Factory macro and VersionSpecificDeriver trait
This change introduces a new \Factory\ trait and companion object in the Scala 2-specific derivation module, providing a macro-based \factory\[A\]\ implicit that delegates to \Derive.derive\. It also adds a \VersionSpecificDeriver\ trait for Scala 2. These additions enable users to create factory methods for schema derivation in Scala 2 environments, complementing the existing derivation logic.
zio-schema-derivation/shared/src/main/scala-2 · high confidence
Add zero-dependency XML codec module
Introduces a new XML codec module in \zio-schema-xml\ that provides schema-based binary encoding and decoding for XML. The module includes \XmlCodec\ as the main entry point, supporting configuration for reader limits (max depth, attributes, text length) and writer options (indentation, declaration, encoding). It handles various schema types including records, enums (with discriminator support), sequences, maps, options, either, fallback, and transforms, along with annotations for XML attributes, namespaces, and field names. The implementation includes dedicated reader and writer components with error handling and streaming support via ZIO streams.
zio-schema-xml/shared · high confidence
Added JSON encoding and decoding examples for ZIO Schema
The examples module now includes new \Decoder\ and \Encoder\ implementations in \example8\ that demonstrate how to serialize and deserialize JSON using ZIO Schema. The \Decoder\ converts JSON structures into \DynamicValue\ and then into typed values via schema, while the \Encoder\ transforms typed values into \DynamicValue\ and subsequently into JSON objects, arrays, and primitives.
zio-schema-examples/shared · high confidence
Added Scala.js and Scala Native support for zio-schema
zio-schema now compiles for Scala.js and Scala Native targets. This change introduces platform-specific implementations for \StandardType\ and \SchemaPlatformSpecific\ in the \js\ and \native\ source directories, enabling schema serialization and deserialization on these platforms. Notable platform-specific behaviors include the availability of \UUID\ generation in Scala Native (whereas it is unavailable in Scala.js) and the unavailability of \Currency\ default value generation on both platforms.
zio-schema/js, zio-schema/native · high confidence
Added automatic test data generation from schemas
The \zio-schema-zio-test\ module now includes \DeriveGen\, a utility that automatically derives \zio.test.Gen\ instances from \Schema\ definitions. This allows users to generate random test data for any type with a schema, supporting primitives, case classes (up to 22 fields), enums (up to 22 cases), collections, options, and more. A corresponding test suite (\DeriveGenSpec\) verifies that the generated values are non-empty and correctly constructed for all supported schema types.
zio-schema-zio-test/shared · high confidence
Added example ZIO Optics derivation via AccessorBuilder
The \ZioOpticsBuilder\ object has been added to demonstrate how to derive ZIO optics (lenses, prisms, and traversals) using the \zio-schema\ \AccessorBuilder\ interface. This implementation supports product schemas for lenses, enum schemas for prisms, and collection schemas (including sequences, maps, and sets) for traversals. Users should note that this example relies on \DynamicValue\ conversions, making it suitable for demonstration purposes rather than high-performance scenarios.
zio-schema-optics/shared/src/main · high confidence
Initial project scaffolding and configuration
The repository has been initialized with the core structure for the ZIO Schema library, including the README, Contributor License Agreement, and build configuration. This change introduces the SBT build system with specific JVM options (6GB heap, G1GC) and integrates Scalafmt 3.11.5 and Scalafix for code formatting and cleanup. It also adds a .gitignore file to exclude common IDE, OS, and build artifacts, and configures Renovate for automated dependency updates.
(repo-wide) · high confidence
Initial release of zio-schema with multi-format codecs and Scala 3 support
This change introduces the core zio-schema library, providing automatic schema derivation for case classes and sealed traits via macros in both Scala 2 and Scala 3. It includes a comprehensive set of codecs for serializing and deserializing data to and from Avro, BSON, JSON, Protobuf, Thrift, XML, and MessagePack. The release also adds support for schema validation, annotations for field naming and transformation, and benchmarking utilities for codec performance.
repository · high confidence
Introduce MessagePack codec for ZIO Schema
Adds a new MessagePack serialization codec to zio-schema, providing \BinaryCodec\ implementations for encoding and decoding data via the MessagePack binary format. The implementation supports a wide range of schema types, including primitive types, records, sequences, maps, sets, tuples, options, either, fallbacks, and case classes up to 22 fields, as well as enums and dynamic values.
zio-schema-msg-pack/src/main · high confidence
Introduction of AvroCodec for encoding and decoding ZIO Schema types
The AvroCodec implementation is now available in the zio-schema-avro module, providing a BinaryCodec that allows users to serialize and deserialize ZIO Schema types to and from Avro binary format. This includes support for encoding and decoding generic records, handling streaming data via ZPipeline, and managing complex schema structures such as enums with up to 22 cases.
zio-schema-avro/src/main · high confidence
Introduction of the Deriver typeclass with caching support
The schema derivation system now uses a new \Deriver\[F\[\_\]\]\ typeclass to build type class instances from schemas, replacing the previous mechanism. This trait allows users to define custom derivation logic for records, enums, primitives, and other schema types, with an optional \summoned\ parameter to respect existing implicit instances. A \cached\ method is provided on the trait to wrap any deriver in a \CachedDeriver\, which uses a \ConcurrentHashMap\ to cache derived instances by schema identity, improving performance for repeated derivations. Helper utilities like \TupleRecordSchema\ are included to support tuple-to-record conversions required by the derivation process.
zio-schema-derivation/shared/src/main/scala · high confidence
New Factory trait and VersionSpecificDeriver for Scala 3
Added a new \Factory\[A\]\ trait and its companion object in \Factory.scala\ to provide a convenient way to create factory methods for schema derivation, allowing users to derive types using a \Deriver\ instance. Additionally, introduced \VersionSpecificDeriver\ in \VersionSpecificDeriver.scala\ to extend the \Deriver\ trait with an inline \derive\ method, simplifying the derivation process for Scala 3 users.
zio-schema-derivation/shared/src/main/scala-3 · high confidence
New schema diffing, migration, and validation capabilities
This release introduces several new capabilities for working with ZIO Schema. Users can now compute differences between values using the new \Differ\ trait and apply patches via the \Patch\ type, accessible through the \diff\ and \runPatch\ syntax methods. Schema migrations are now supported, allowing values to be transformed from one schema version to another using the \migrate\ syntax method. Additionally, the library adds comprehensive validation rules, including phone number validation for numerous countries, email validation (supporting IP domains and RFC 3696 length limits), and duration validation. The release also adds support for Scala 3 \IArray\ collections and provides new \SchemaEquality\ and \SchemaOrdering\ implementations for comparing and sorting schemas.
zio-schema/shared/src/main · high confidence
Scala 2 macro for capturing source location metadata
A new Scala 2 macro implementation has been added to capture source location details (file path, line, and column) at compile time. This enables schema definitions to automatically include precise location metadata, which can be used for better error reporting and debugging of schema structures.
zio-schema-macros/shared · high confidence
Thrift codec now supports in-memory transport for encoding and decoding
The \zio-schema-thrift\ module introduces \ChunkTransport\, a new in-memory transport implementation that wraps Apache Thrift's \TMemoryTransport\ to work seamlessly with ZIO's \Chunk\[Byte\]\. This addition enables the Thrift codec to serialize and deserialize data directly to and from ZIO chunks without requiring file or network streams. The change is accompanied by a comprehensive test suite (\ThriftCodecSpec\) and a set of generated Java Thrift model classes (e.g., \BasicInt\, \HighArity\, \Color\) that verify the codec's ability to correctly handle basic types, nested structures, high-arity records, enums, and collections.
zio-schema-thrift · high confidence
Test coverage
Added JVM-specific tests for JSON decoding edge cases; Added Protobuf encoding/decoding benchmarks; Added Scala 3-specific JSON codec tests; Added Scala 3-specific tests for schema derivation and typeclass macros; Added comprehensive test coverage for Avro codec encoding and decoding; Added comprehensive test coverage for JSON codec; Added comprehensive test coverage for schema accessors, default values, and dynamic value round-trips; Added comprehensive test coverage for validation logic; Added comprehensive test suite for MessagePack codec; Added comprehensive test suite for ProtobufCodec; Added platform-specific test generators for Scala 3; Added schema comparison assertion utilities; Added test coverage for XML codec with diverse sample resources; Added test coverage for schema derivation and validation; Added tests for Lens optics laws; Added tests for Scala 3 IArray schema derivation.
Dependencies
Initial build configuration and documentation metadata
The project introduces its primary build definition in \build.sbt\, establishing the \zio-schema\ library structure with cross-compilation support for JVM, Scala.js, and Scala Native across Scala 2.12, 2.13, and 3. It configures CI workflows via the \zio-sbt-ci\ plugin to run tests on Java 17 and 21, and adds minimal \package.json\ files to the \docs\ and \website/docs\ directories to define the NPM package metadata for documentation publishing.
(dependencies) · high confidence
Updated build infrastructure and dependency versions
The project's build configuration has been updated to use sbt 1.13.0 and upgraded several key plugins and libraries, including sbt-scalajs to 1.22.0, sbt-scala-native to 0.5.12, and sbt-mima-plugin to 1.1.6. Core library dependencies have also been bumped, such as ZIO to 2.1.26, ZIO-JSON to 1.1.0, and Avro to 1.12.2, while the supported Scala versions are now 2.12.21, 2.13.18, and 3.9.0.
project · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 62 → 54 (-8.4)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 63 → 63 (+0.0)
- Architecture 92 → 90 (-1.2)
- Maturity 58 → 61 (+3.9)
- Readiness 64 → 51 (-13.5)
- Security 68 → 47 (-21.3)
- Performance 77 → 89 (+11.5)
Resolved (3)
- Off-boarding risk: anonymized user #1
- Outdated: dev.zio:zio_2.13
- Outdated: org.apache.thrift:libthrift
New (1)
- Dependency hygiene PARTLY measured — sbt declarations read, dependency currency not (Maven Central unreachable)
Architecture
- Unchanged — 0 containers · 1 contexts · 0 edges
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
zio/zio-schema was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 7 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit bc88fdb8b207ef714923935e5e83bbd164724e4d — the exact code this score is about.
- Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.3+preprod-5f8314471808.