zio/zio-json
62.5
Adequate · 20 September 2026
16.8k
lines of production code
Scala
primary language
1
measurement over time
What this system is
This system is a high-performance JSON and YAML serialization library for the Scala ecosystem, supporting JVM, JavaScript, and Native platforms. It provides automatic codec derivation via Scala 3 macros and offers extensive interoperability modules for popular libraries such as http4s, enumeratum, refined, and Scalaz. The library also includes utilities for streaming large datasets via ZIO Streams and snapshot testing for verifying serialization correctness.
How it got here
2020 — Scala 3 migration and ZIO ecosystem alignment
11 changes.
The project underwent a significant infrastructure overhaul, migrating the build system to SBT 1.13 and Scala 3 while replacing the legacy Magnolia dependency with native Scala 3 macros for codec derivation. This period also saw the removal of manual JSON parsing logic in favor of a derivation-based approach, alongside a comprehensive shift of the test suite to ZIO-Test and the addition of new modules for YAML serialization and golden file testing.
2021 — multi-platform and interop expansion
13 changes.
This period focused on expanding zio-json's platform support and ecosystem integration, notably adding Scala.js compatibility and JVM-specific streaming I/O capabilities. The team also introduced new modules for YAML serialization and interoperability with http4s, Refined, and Scalaz, accompanied by comprehensive test coverage for these features and core AST functionality.
2022–2026 — Testing infrastructure and platform expansion
8 changes.
This period focused on expanding the library's ecosystem by introducing Scala Native support and an interop module for enumeratum enums. Significant effort was also directed toward enhancing test reliability and coverage through the creation of a golden testing framework and comprehensive updates to internal lexer and derivation test suites.
Features
Add HTTP4s interop example project
Added a new example project in examples/interop-http4s that demonstrates integrating zio-json with HTTP4s. The project includes a runnable server (Main.scala, Server.scala) that starts an HTTP4s Blaze server on port 8080, and route definitions (HelloWorldRoutes.scala) that handle GET requests to /hello/{name}, returning a JSON greeting. A README is included to guide users on running the example via sbt and testing it with curl.
examples/interop-http4s · high confidence
Add JSON serialization support for Scalaz IList
This change introduces a new interop module for Scalaz 7.x, providing implicit JSON encoders and decoders for the Scalaz \IList\ type. Users can now seamlessly serialize and deserialize \IList\ instances to and from JSON strings using zio-json, with dedicated tests verifying correct behavior for both empty and populated lists.
zio-json-interop-scalaz7x/shared · high confidence
Add JVM-specific streaming JSON I/O and encoding pipelines
This change introduces platform-specific implementations for the JVM that enable streaming JSON operations. Users can now read JSON from files, paths, URLs, or byte/character streams using \ZStream\ via the new \JsonPackagePlatformSpecific\ trait. Additionally, \JsonDecoder\ and \JsonEncoder\ gain \decodeJsonPipeline\ and \encodeJsonLinesPipeline\/\encodeJsonArrayPipeline\ methods, allowing efficient, memory-conscious processing of large JSON datasets through ZIO streams rather than loading entire payloads into memory.
zio-json/jvm/src/main · high confidence
Add Refined type interop for JSON encoding and decoding
This change introduces a new interop module that enables seamless serialization and deserialization of types refined by the \refined\ library. It provides implicit \JsonEncoder\ and \JsonDecoder\ instances for \Refined\ values, ensuring that validation rules are enforced during decoding (e.g., rejecting invalid JSON for non-empty strings) while encoding simply unwraps the refined value. The module also supports field-level encoding/decoding for refined types, allowing refined fields in case classes to be handled correctly during JSON operations.
zio-json-interop-refined/shared · high confidence
Add ZIO JSON integration for http4s
This release introduces the \zio-json-interop-http4s\ module, providing seamless JSON serialization and deserialization for http4s services using ZIO. It adds \EntityEncoder\ and \EntityDecoder\ instances that allow http4s routes to directly read and write case classes encoded with zio-json, handling content-type negotiation and malformed JSON errors automatically.
zio-json-interop-http4s · high confidence
Add ZIO JSON interop for enumeratum enums
This release adds a new interop module that enables seamless JSON serialization and deserialization of enumeratum enums using the ZIO JSON library. Users can now easily encode and decode standard enumeratum enums (supporting case-insensitive, lowercase, and uppercase variants) as well as value-based enums (Int, Long, Short, String, Char, and Byte) directly to and from JSON. The module provides helper traits like ZioJsonEnum and ZioJsonValueEnum to automatically supply the necessary implicit encoders and decoders, and also supports using enum members as keys in JSON objects.
zio-json-interop-enumeratum/shared · high confidence
Added Scala Native platform support stubs
The zio-json library now includes initial support for the Scala Native platform. This change introduces platform-specific trait stubs (JsonPackagePlatformSpecific, JsonDecoderPlatformSpecific, and JsonEncoderPlatformSpecific) within the native source directory, establishing the structural foundation for native compilation and future platform-specific implementations.
zio-json/native · high confidence
Added http4s interop example project
A new example project demonstrating the ZIO JSON http4s interop has been added, providing a concrete implementation of a service that encodes case classes into JSON responses using http4s entity encoders.
interop-http4s · high confidence
Initial Scala.js support for zio-json
zio-json now supports Scala.js, enabling JSON encoding and decoding in JavaScript environments. This change introduces platform-specific implementations for the \Write\ interface (via \FastStringWrite\) and adds platform-specific traits for encoders and decoders, allowing the library to function correctly on the JS platform alongside existing JVM and Native targets.
zio-json/js · high confidence
Initial implementation of YAML value construction logic
The zio-json-yaml module introduces its initial version, adding the YamlValueConstruction class to handle the conversion of YAML nodes into Java values. This internal component extends SnakeYAML's SafeConstructor to provide a secure parsing foundation, specifically implementing methods to construct values from nodes and process mapping nodes by flattening them before use.
zio-json-yaml/src/main/scala/zio/json/yaml/internal · high confidence
Initial release of zio-json-yaml module
This change introduces the new zio-json-yaml module, providing implicit extension methods to convert between zio-json ASTs and YAML strings. Users can now encode JSON values to YAML using \toYaml\ (with configurable options like indentation and null handling) and decode YAML strings back into typed Scala values using \fromYaml\, leveraging the SnakeYAML library for serialization and parsing.
zio-json-yaml/src/main/scala/zio/json/yaml · high confidence
Introduce zio-json-golden for snapshot testing of JSON codecs
The new zio-json-golden module provides golden (snapshot) testing capabilities for verifying that data types serialize and deserialize as expected. It introduces a \goldenTest\ API that generates sample data, compares it against stored reference files in \src/test/resources/golden/\, and flags mismatches by creating \\_changed\ files for review. The module includes configuration options for customizing the output directory path and sample size, and is demonstrated with tests for Int, SumType, RecordType, and filtered Gen instances.
zio-json-golden · high confidence
Native Scala 3 derivation and expanded type support
The library now uses native Scala 3 macros for \JsonCodec\, \JsonEncoder\, and \JsonDecoder\ derivation, removing the previous Magnolia dependency for Scala 3 builds. This change introduces support for \IArray\ (immutable arrays) and enables automatic derivation for union types composed of string-based literals (enums). Additionally, the \JsonFieldDecoder\ now supports decoding object keys from any subtype of \String\, and version-specific files ensure \immutable.ArraySeq\ is handled correctly across Scala 2.12, 2.13, and 3.
zio-json/shared/src/main · high confidence
New golden file testing support and YAML serialization module
This change introduces a new \zio-json-golden\ module for snapshot testing, providing \GoldenConfiguration\ to control output paths and sample sizes, and \GoldenSample\ to store JSON ASTs for comparison. It also adds a new \zio-json-yaml\ module, introducing \YamlOptions\ to configure YAML serialization behavior such as indentation, null handling, and scalar styles. Additionally, the \jsonDerive\ macro annotation is added to allow explicit derivation of JSON codecs for case classes and sealed traits with configurable output types (codec, encoder, or decoder).
repository · high confidence
Behavioural changes
Project license changed from BSD to Apache 2.0
The project license has been updated from the BSD license to the Apache License, Version 2.0. This change affects the legal terms under which the software can be used, reproduced, and distributed.
(repo-wide) · high confidence
Removal of legacy JSON parsing and encoding infrastructure
The library has removed its previous manual JSON implementation, including the \zio.json.ast\ module for representing JSON as an Abstract Syntax Tree, the core \Decoder\ and \Encoder\ traits, the low-level \Lexer\ and \SafeNumbers\ parsing utilities, and the custom \Reader\/\Writer\ classes. Additionally, the \deriving.conf\ configuration file that previously pointed to these internal components has been deleted. This change eliminates the manually maintained parsing logic in favor of the library's new derivation-based approach.
src/main · high confidence
Updated JVM benchmark suite with new collection/UUID benchmarks and Play JSON removal
The JVM benchmark suite in \zio-json/jvm/src/jmh/scala/zio/json\ has been refreshed to reflect current API usage and performance priorities. New benchmarks were added for \Array\[Boolean\]\ allocation reproduction, \Chunk\[Byte\]\ decoding (including concatenated chunks), general collection encoding/decoding (List, Vector, Map, Set, etc.), and UUID parsing. Existing benchmarks (GeoJSON, Google Maps, Twitter) were migrated to use the modern \.fromJson\/\.toJson\ syntax and direct \JsonEncoder\/\JsonDecoder\ references, and all Play JSON comparison benchmarks were removed.
zio-json/jvm/src/jmh/scala/zio/json · high confidence
Updated floating-point and BigDecimal benchmarks to use 256-bit mantissa limit
The JVM benchmark suite for zio-json has been updated to align with the 256-bit mantissa limitation for parsing floating-point numbers. Specifically, the \SafeNumbersBenchFloat\ and \SafeNumbersBenchBigDecimal\ classes now invoke \UnsafeNumbers.float\ and \UnsafeNumbers.bigdecimal\ with a precision argument of 256, replacing the previous value of 128. This change ensures that the performance measurements reflect the current parsing behavior and limits applied to these numeric types.
zio-json/jvm/src/jmh/scala/zio/json/internal · high confidence
Test coverage
Added GeoJSON and Google Maps data models for testing; Added JSONTestSuite test resources for JVM validation; Added Scala 3-specific codec derivation and collection tests; Added golden file tests for JSON encoding and decoding; Added test coverage for JSON lexer, number parsing, and string matching; Added tests for JSON derivation macros; Expanded test coverage for JSON codec annotations, AST handling, and low-level decoding; Initial test coverage for YAML encoder and decoder; Initial test coverage for the JSON AST module; JVM-specific decoder/encoder streaming and corpus tests; Migrate test suite from utest/scalaprops to ZIO-Test; Updated Twitter data model test fixtures to use modern derivation APIs.
Dependencies
Migrate build to ZIO SBT CI and update core dependencies
The project build has been migrated to use the zio-sbt-ci plugin, introducing automated checks for benchmark compilation and binary compatibility (MiMa) on the series/2.x branch. The root build.sbt has been significantly restructured to support cross-compilation across Scala 2.12, 2.13, and 3.x, as well as JVM, JS, and Native platforms. Key dependency updates include upgrading ZIO to version 2.1.26 and removing the Magnolia dependency for Scala 3 in favor of native macros. Additionally, new example projects for http4s interop and golden testing have been added, along with a documentation package configuration.
(dependencies) · high confidence
Upgrade to SBT 1.13 and Scala 3.9 with modernized build infrastructure
The build system has been upgraded to SBT 1.13.0 (from 1.3.13) and Scala 3.9.0 (alongside Scala 2.12.21 and 2.13.18), requiring JDK 17 as the minimum version. The project now uses idiomatic SBT syntax (slash-style scoping) and integrates a comprehensive set of plugins including sbt-ci-release, sbt-mima-plugin, sbt-buildinfo, and zio-sbt-website. Benchmarking support via NeoJmhPlugin has been updated to JMH 1.37, and the build now includes binary compatibility checks via MiMa and explicit dependency management.
project · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 62.
Lenses
- Code Health 71
- Architecture 100
- Maturity 51
- Readiness 89
- Security 65
Changes since last survey
- 300 commits — 289 feature/other, 11 fixes
By area
- (root) — 115 commits
- project/plugins.sbt — 69 commits
- .github/workflows — 38 commits
- zio-json/shared — 33 commits
- examples/zio-json-golden — 20 commits
- (repo) — 6 commits
- project/BuildHelper.scala — 6 commits
- project/build.properties — 6 commits
- zio-json/jvm — 4 commits
- .github/dependabot.yml — 1 commit
- zio-json-interop-enumeratum/shared — 1 commit
- zio-json-yaml/src — 1 commit
Notable commits
- fix: Fix MiMa binary compatibility check for JS and Native (#1558)
- fix: Fix ArrayIndexOutOfBoundsException when decoding too long string as java.time._ values (#1358)
- fix: Fix Lexer.skipValue throwing UnexpectedEnd on bare number literals at EOF (#1585)
- fix: Fix toJsonAST implementation for product types + More efficient toJsonAST implementation for product types and collections + Update magnolia to 1.3.16 (#1344)
- fix: Fix error message for invalid boolean (#1371)
- fix: Fix error message inconsistencies between immediate decoding and through AST (#1350)
- fix: Fix missing error when decoding of Json.Str values that ends by non-digit characters to numbers (#1352)
- fix: Fix unexpected "(duplicate)" error when decoding products with more than 64 fields (#1376)
- fix: Fix unwanted skipping of required fields that has values of product types + yet more efficient encoding of product types (#1343)
- fix: Remove redundant methods and parameters + turn on scalac optimization + fix scalac warnings (#1692)
- fix: Update zio-sbt-website to snapshot with .mdx generateReadme fix (#1663)
- change: Add Scala Steward & Dependabot to help maintaining the repo (#1393)
- change: Add IArray support (#1439) (#1440)
- change: Add Json.Obj(key, value) constructor (#1430)
- change: Add a benchmark for decoder throughput vs case class nesting depth (#1653)
- change: Add a benchmark for decoding through orElse (#1652)
- change: Add a compile-time option to toggle serialization of enum values and sealed trait's case objects as JSON strings or JSON objects (#1339)
- change: Add a reproduction for the byte-vs-string allocation report on #1649 (#1655)
- change: Add enumeratum interop (#1567)
- change: Add support up to 128 cases in sum types and up to 128 fields in product types (#1374)
- …and 280 more
Architecture
- 0 containers · 2 bounded contexts · 1 dependency edges (baseline)
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
zio/zio-json 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 20 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 5b575362f6eb29c022f194b678a6051b951f3e43 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.