playframework/play-json
61.7
Adequate · 20 September 2026
13.7k
lines of production code
Scala
primary language
1
measurement over time
What this system is
Play JSON is a high-performance, cross-platform library for serializing and deserializing JSON data in Scala applications. It provides comprehensive support for JVM, JavaScript, and Scala Native environments, featuring automatic derivation for case classes, enums, and value classes via macros and typeclasses. The system handles complex data structures including maps with non-string keys, large decimals, and streaming I/O, while maintaining binary compatibility and rigorous performance benchmarks.
How it got here
2016 — Play JSON v4 migration and Scala 3 support
9 changes.
This period focused on migrating the Play JSON library to the Play Framework organization, upgrading the build infrastructure to sbt 2.0, and adding comprehensive support for Scala 3 and multi-platform targets. The work involved removing legacy Java APIs and old core implementation files while introducing new functional applicative behaviors and updating documentation and benchmarks.
2017 — Scala.js support and streaming I/O
9 changes.
The project introduced native JavaScript bindings for JSON parsing and serialization, enabling efficient integration with the browser environment. It also added streaming I/O capabilities and safeguards for large decimal numbers to improve performance and security. Additionally, support for Joda-Time types and non-String Map keys was implemented, accompanied by a migration of the test suite to ScalaTest.
2018–2022 — Scala 3 support and performance optimization
10 changes.
This period focused on extending Play JSON to support Scala 3, including new macros for enums, value classes, and type-class derivation, alongside comprehensive test coverage for these features. The work also involved modernizing internal collection handling for Scala 2.13+ and introducing JMH benchmarks to analyze and optimize JSON serialization and deserialization performance.
2023–2026 — Scala Native and Java Enum support
6 changes.
This period focused on extending Play JSON's compatibility to non-JVM environments by implementing full Scala Native support for JSON parsing and writing via the Jawn library. Additionally, the project added comprehensive serialization and deserialization capabilities for Java enums across all platforms, accompanied by extensive test coverage for both new features.
Features
Add JSON parsing support for Scala Native via Jawn
Play JSON now supports parsing JSON data into JsValue objects on Scala Native platforms. This is achieved by introducing a new StaticBinding module that delegates parsing logic to the Jawn library, enabling users to parse JSON from byte arrays, strings, and input streams. Existing serialization and pretty-printing operations continue to be handled by the existing non-JVM bindings.
play-json/native/src/main · high confidence
Add JavaScript-specific JSON parsing and serialization via native bindings
The Play JSON library now includes a dedicated implementation for Scala.js that leverages the browser's native \JSON.parse\ and \JSON.stringify\ methods for reading and writing JSON data. This new \StaticBinding\ object in the \play-json/js\ module provides the core functionality for parsing JSON strings and byte streams into \JsValue\ objects and serializing \JsValue\ back to strings or byte arrays, ensuring efficient integration with the JavaScript environment without relying on external libraries.
play-json/js/src/main · high confidence
Add Joda-Time JSON serialization support
The play-json-joda module now provides implicit Reads and Writes for Joda-Time types (DateTime, LocalDate, LocalTime), enabling seamless conversion between JSON and these date/time objects. Users can leverage default formatters or specify custom patterns for serialization and deserialization.
play-json-joda/src/main/scala/play/api/libs/json · high confidence
Added Scala Native support for JSON parsing and writing
Play JSON now supports Scala Native platforms (JS and Native) by introducing platform-specific implementations for reading and writing JSON. This includes new \EnvReads\ and \EnvWrites\ traits for environment-specific handling, and a \StaticBindingNonJvm\ object that provides core functionality such as parsing JSON from input streams, converting \JsValue\ to bytes or strings, and pretty-printing JSON output. This enables developers to use Play JSON's serialization and deserialization features in non-JVM environments.
play-json/js-native · high confidence
Documentation and benchmarking updates for Play JSON
This release brings the Play JSON documentation and benchmarking suite up to date. The manual now includes comprehensive examples for Scala 2 and Scala 3, demonstrating both manual combinator-based JSON transformations and automated derivation using \derives\ and \Json.format\. Additionally, new JMH benchmarks have been added to measure performance for parsing large JSON objects and deserializing nullable fields, helping users understand the library's efficiency in these scenarios.
repository · high confidence
New KeyReads and KeyWrites typeclasses for non-String Map keys
The library now supports Maps with non-String keys (such as Int, Boolean, Char, and numeric types) by introducing KeyReads and KeyWrites typeclasses. These new typeclasses allow users to serialize and deserialize Maps where keys are not strings, extending the existing Reads and Writes infrastructure to handle key conversion explicitly.
play-json/shared/src/main/scala/play/api/libs/json · high confidence
New streaming I/O and BigDecimal parsing safeguards
The play-json library now supports writing JSON directly to output streams via the new \StaticBinding.writeToStream\ and \StaticBinding.prettyPrintToStream\ methods, enabling efficient handling of large payloads without loading the entire JSON structure into memory. Additionally, a new \BigDecimalParser\ has been introduced to enforce configurable limits on the number of digits and scale when parsing large decimal numbers, protecting the application from potential denial-of-service issues caused by excessively large numeric inputs.
play-json/jvm/src/main/scala/play/api/libs/json · high confidence
Support for Java Enum serialization in Play JSON
Play JSON now supports reading and formatting Java enums. This change adds platform-specific macro implementations (Scala 2 and Scala 3) for JVM, JS, and Native targets that enable automatic conversion between Java enum constants and their string representations in JSON, allowing developers to seamlessly serialize and deserialize Java enum types without manual configuration.
(repo-wide) · high confidence
Support for Scala 3 enums and value classes in JSON serialization
The Scala 3-specific JSON macros in play-json now support Scala 3 enums and value classes. Users can serialize and deserialize Scala 3 \enum\ types using \Json.enumReads\ and \Json.enumWrites\, with options for case-insensitive matching or forcing upper/lowercase output. Additionally, value classes (types extending \AnyVal\) are now supported via \Json.valueReads\, \Json.valueWrites\, and \Json.valueFormat\, allowing seamless JSON handling for these lightweight wrappers.
play-json/shared/src/main/scala-3/play/api/libs/json · high confidence
Removals
Removal of Java JSON API
The \play.libs.Json\ class and its associated test suite have been removed from the \play-json\ module. This eliminates the Java-specific helper methods for parsing, serializing, and manipulating JSON nodes (such as \parse\, \toJson\, \fromJson\, and \stringify\), meaning Java applications can no longer use this legacy API for JSON operations within this library.
play-json · high confidence
Removal of play-json core implementation files
The core implementation files for the play-json library in play/api/libs/json have been deleted, including the main JSON handling classes (Json, JsPath, JsResult, Reads, Writes), the macro implementation (JsMacroImpl), and the Jackson integration module (JacksonJson). This change removes the existing JSON serialization, deserialization, and path-based access capabilities provided by this module.
play-json/src/main/scala/play/api/libs/json · high confidence
Behavioural changes
Applicative.pure now uses by-name parameters to ensure laziness
The \Applicative\ trait in the \play-functional\ library has been updated so that its \pure\ method accepts a by-name parameter (\f: =\> A\) instead of a strict value. This change ensures that the value is evaluated only when necessary, fixing previous issues where \pure\ evaluated arguments eagerly. To maintain backward compatibility, a deprecated \pure\ method accepting a strict value remains available but delegates to the new by-name version. Implementations, such as the \Option\ applicative, have been updated to reflect this signature change.
play-functional/src/main/scala/play/api/libs/functional · high confidence
Automated multi-version Scala testing and publishing script
A new executable script, scripts/test-code.sh, has been added to automate the testing and local publishing of the project across multiple Scala versions (2.12.x, 2.13.x, and 3.3.x). The script configures SBT to use 90% of available memory for tests and conditionally skips documentation tests for Scala 2.12, reflecting that Play 2.9.x is no longer published for that version.
scripts · high confidence
Introduces Scala 2.13+ specific JSON collection implementations
This change adds new internal classes and objects to the play-json library to support Scala 2.13+ collections. Specifically, it introduces \ImmutableLinkedHashMap\ to wrap Java's \LinkedHashMap\ as an immutable Scala map, mitigating hash collision issues in \jsObject.value\. It also adds \JsObjectBuilder\ for efficient construction of JSON objects, \MapWrites\ to provide serializers for \Map\[String, V\]\ types using Scala 2.13's collection traits, and a local \ScalaCollectionCompat\ object to replace the external \scala-collection-compat\ dependency for stable binary API access.
play-json/shared/src/main/scala-2.13+/play/api/libs/json · high confidence
Introduces internal collection compatibility and builder utilities for Scala 2.12 and earlier
This change adds four new internal files to the Scala 2.12- source directory to support cross-building and improve collection handling. It introduces \ImmutableLinkedHashMap\ to wrap Java's \LinkedHashMap\ as a Scala immutable map, addressing hash collision mitigation for \JsObject\ values. It also adds \JsObjectBuilder\ to efficiently construct \JsObject\ instances, \MapWrites\ to provide serialization for \Map\[String, V\]\ types, and \ScalaCollectionCompat\ to backport Scala 2.13 collection factory APIs (replacing the external \scala-collection-compat\ dependency) for older Scala versions.
play-json/shared/src/main/scala-2.13-/play/api/libs/json · high confidence
Project rebranding, license update, and documentation overhaul
The project has been rebranded from 'Play JSON' to 'Play JSON' under the \org.playframework\ Maven group ID, replacing the previous \com.typesafe.play\ coordinates. The license file has been updated to the standard Apache 2.0 text with full legal terms. Additionally, the \README.md\ has been significantly expanded to include comprehensive usage documentation for Scala 2.12, 2.13, and Scala 3, covering JSON AST, traversal, and serialization, while the \version.sbt\ file was removed in favor of dynamic versioning.
(repo-wide) · high confidence
Scala 2 JSON macro implementation and compatibility traits
This change introduces the Scala 2-specific implementation of the JSON macro system, including the \JsMacroImpl\ class that generates \Reads\, \OWrites\, and \OFormat\ instances for case classes and value classes at compile-time. It also adds \EnumerationWrites\ to provide implicit serialization for Scala enumerations by name, and establishes several private compatibility traits (\ScalaCompatJson\, \ScalaCompatFormat\, etc.) to support the \Json\ companion object and macro interfaces within the Scala 2 codebase.
play-json/shared/src/main/scala-2/play/api/libs/json · high confidence
Syntax package formatting and Scaladoc updates
The \play.api.libs.functional.syntax\ package has been reformatted to improve code readability, including line breaks for implicit conversion methods and indentation adjustments. The Scaladoc comment has been updated to use backticks for the import statement instead of triple braces, and the copyright header has been refreshed to reflect 2022 ownership by The Play Framework Contributors. Additionally, the \unapply\ method implementation was simplified by removing the explicit parameter type annotation in favor of a direct function application.
play-functional/src/main/scala/play/api/libs/functional/syntax · high confidence
Updated Mima exclusions and test logging configuration
This change updates the Play JSON library's binary compatibility filters and test infrastructure. It adds Mima exclusions for deprecated Joda-Time serialization methods in the 2.8.x branch and excludes a missing type problem for the internal JsonConfigImpl class in the 3.1.x branch, ensuring smooth upgrades for users. Additionally, the test logging configuration (logback-test.xml) has been migrated to Logback's new canonical XML format, which may affect how test logs are formatted or processed during development.
play-json/jvm · high confidence
Test coverage
Added JMH benchmarks for Play JSON performance analysis; Added JavaScript-specific JSON parsing tests; Added Scala 2-specific test coverage for JSON macros and formatting; Added Scala 3-specific test coverage for JSON derivation macros; Added Scala 3-specific tests for Play JSON enum serialization; Added Scala Native test suite and test utilities; Added memory footprint tests for JSON parsing and JsObject operations; Added test support for Java enum serialization; Added tests for Scala 3 enum serialization; Added validation tests for Joda-Time JSON serialization; Expanded test coverage for play-json JVM module; Migrate play-json tests to ScalaTest and add shared test suite; Removal of legacy JSON library test suite.
Dependencies
Major build infrastructure overhaul: Scala 3 support, multi-platform targets, and dependency upgrades
The build system has been significantly restructured to support Scala 3 alongside Scala 2.13, enabling cross-compilation for JVM, JavaScript, and Native platforms via sbt-crossproject. Key dependency updates include Jackson 2.22.2, Specs2 4.23.0, and Joda-Time 2.14.3, while the project now targets Java 17. Binary compatibility is managed via MiMa against version 3.1.0-M1, and the build now includes separate artifacts for functional and JSON libraries across all supported platforms.
(dependencies) · high confidence
Migrate build system to sbt 2.0 and update plugin ecosystem
The project build has been upgraded from sbt 0.13.13 to sbt 2.0.8, requiring a significant update to the plugin ecosystem. The build now uses \sbt-ci-release\ 1.12.1 for publishing, \play-docs-sbt-plugin\ 3.1.0-M10 for documentation, and \sbt-mima-plugin\ 1.2.0 for binary compatibility checks. Additionally, support for Scala.js 1.22.0, Scala Native 0.5.12, and Scala 3.9/3.10 has been added via new cross-project plugins, while the previous \interplay\ dependency has been removed in favor of local \Common.scala\ configuration.
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 88
- Architecture 66
- Maturity 57
- Readiness 73
- Security 60
Changes since last survey
- 300 commits — 285 feature/other, 15 fixes
By area
- (repo) — 90 commits
- (root) — 70 commits
- project/plugins.sbt — 46 commits
- play-json/jvm — 28 commits
- play-json/shared — 22 commits
- project/build.properties — 14 commits
- .github/workflows — 13 commits
- project/Dependencies.scala — 7 commits
- .github/scala-steward.conf — 4 commits
- .github/dependabot.yml — 3 commits
- docs/manual — 3 commits
Notable commits
- fix: Fix #836 - Update Scala 3 macro for nesting class support
- fix: Fix #971 – "Exception occurred while executing macro expansion." (#994)
- fix: Fix #974 – Scala 3 macro cannot find Writes for Seq[Map[String, T]] (#993)
- fix: Fix #985 - Handle exception in InstantFormatterParser (#1407)
- fix: Fix JsonMemoryFootprintSpec on JDK 21 / Scala 3
- fix: Fix Dependency Graph action
- fix: Fix flaky tests (#1229)
- fix: Merge pull request #1021 from playframework/revert-1002-update/sbt-scalajs-1.16.0
- fix: Merge pull request #1042 from levinson/field-ordering-scala3-bug
- fix: Merge pull request #1114 from ihostage/fix-dep-graph
- fix: Merge pull request #956 from cchantep/fix/836_scala3_macro_nesting_class
- fix: Revert "Skip native artifacts from MiMa checks"
- fix: Revert "Temporary disable MiMa"
- fix: Revert "sbt-scalajs, scalajs-compiler, ... 1.16.0 (was 1.15.0)"
- fix: fix field ordering Scala 3 writes macro
- change: --- updated-dependencies: - dependency-name: scalacenter/sbt-dependency-submission dependency-type: direct:production update-type: version-update:semver-major ...
- change: Add 'Reformat with scalafmt 3.7.17' to .git-blame-ignore-revs
- change: Add 'Reformat with scalafmt 3.8.2' to .git-blame-ignore-revs
- change: Add -Yfuture-lazy-vals option (#1324)
- change: Add recursive methods (#1306)
- …and 280 more
Architecture
- 0 containers · 1 bounded contexts · 0 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
playframework/play-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 79394161b30aaf69e3baadbb5346043a65d088da — 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.