Skip to content
CAI
Software that uses CAICheck a score

thoth-org/Thoth.Json

64.8

Adequate · 17 September 2026

9.1k

lines of production code

F#

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

Thoth.Json is a multi-target JSON serialization library for F\# that provides type-safe encoding and decoding capabilities across .NET, JavaScript, and Python platforms. It offers both manual and automatic codec generation, supporting various naming conventions and integrating with Newtonsoft.Json and System.Text.Json backends. The system includes a modernized build infrastructure with automated testing and benchmarking to ensure performance and consistency across all supported targets.

How it got here

2019–2023 — Multi-target architecture and codec rewrite

20 changes.

The project underwent a major architectural overhaul, replacing the legacy build system and dependency management with a modern .NET SDK-based structure supporting .NET, JavaScript, and Python targets. This period introduced a new declarative Codec abstraction and computation expressions in Thoth.Json.Core, alongside comprehensive test suites for all supported backends to ensure robust serialization and deserialization.

2024–2026 — Auto API and System.Text.Json integration

7 changes.

This period focused on expanding Thoth.Json's capabilities by introducing an auto-generated codec API for F\# types and a new adapter for System.Text.Json. The work included building a comprehensive benchmark suite to compare performance across backends and adding extensive test coverage for the new features and existing codecs.

Features

Add Python backend for Thoth.Json encoding and decoding

Introduces a new Python target for Thoth.Json, allowing F\# code to serialize and deserialize JSON using Python's standard \json\ module. The \Encode\ module provides \toString\ and \fromCodec\ functions that leverage \Fable.Python.Json.dumps\ with \ensureAscii = false\ to support non-ASCII characters, while the \Decode\ module exposes \fromString\, \fromValue\, and \unsafeFromString\ to parse JSON strings into F\# types using Python's \json.loads\. This adds a new platform-specific implementation alongside the existing JavaScript backend.

packages/Thoth.Json.Python · high confidence

Added .NET benchmark suite for JSON serialization performance

A new benchmark project has been introduced to measure and compare the performance of JSON serialization and deserialization. The suite includes benchmarks for Thoth.Json using both Newtonsoft and System.Text.Json backends, as well as direct comparisons against the native Newtonsoft and System.Text.Json libraries. Results are ordered from fastest to slowest to facilitate easy performance analysis.

Thoth.Json.DotNet.Benchmark · high confidence

Added case strategy support for JSON serialization

Thoth.Json now supports configurable naming conventions for JSON keys, allowing users to serialize and deserialize data using PascalCase, CamelCase, or SnakeCase formats. This is implemented via a new CaseStrategy type and utility functions in the core library, enabling more flexible integration with APIs that use different casing standards.

Thoth.Json · high confidence

Customizable Newtonsoft.Json settings for encoding and decoding

Users can now pass custom Newtonsoft.Json JsonSerializerSettings when parsing or serializing JSON via the new fromStringWithOptions and toStringWithOptions methods. This allows control over options such as DateParseHandling and CheckAdditionalContent, replacing the previous behavior where settings were fixed or implicitly applied.

packages/Thoth.Json.Newtonsoft · high confidence

Introduce Auto API for automatic JSON encoding/decoding in Thoth.Json.Core

This change adds the Thoth.Json.Core.Auto package, providing an 'Auto' API that automatically generates JSON coders for F\# types. The implementation includes a CaseStrategy type to configure field and union case naming conventions (such as SnakeCase, PascalCase, and DotNetCamelCase) and an ExtraCoders system that allows users to register custom coders or built-in support for specific types like int64, uint64, decimal, and bigint. This enables users to serialize and deserialize complex types without manually defining individual encoders and decoders.

Thoth.Json.Core.Auto · high confidence

Introduce Codec abstraction and Decoder Computation Expression

Thoth.Json.Core now provides a \Codec\ module that pairs encoders and decoders into a single reusable unit, including built-in codecs for common types like strings, integers, and URIs. Additionally, a new Decoder Computation Expression (\decoder { ... }\) is available, allowing users to compose decoders using \let!\ and \and!\ syntax for more readable and concise decoding logic.

packages/Thoth.Json.Core · high confidence

Introduce Thoth.Json.System.Text.Json adapter for System.Text.Json

The new \Thoth.Json.System.Text.Json\ package provides a bridge allowing Thoth.Json.Core decoders and encoders to operate on \System.Text.Json\ types (\JsonElement\ and \JsonNode\). This enables users to leverage the performance and features of the .NET Standard library's JSON stack while retaining Thoth's type-safe decoding/encoding logic. The adapter exposes \Decode.fromStringWithOptions\ to accept \JsonDocumentOptions\ (allowing configuration like \MaxDepth\ or trailing comma handling) and \Encode.toStringWithOptions\ to pass \JsonSerializerOptions\ for controlling indentation and escaping.

packages/Thoth.Json.System.Text.Json · high confidence

Introduce auto-generated JSON codecs for Thoth.Json.Core

This release adds the \Thoth.Json.Core.Auto\ package, which provides automatic generation of JSON encoders and decoders for F\# types via \Codec.Auto.generateCodec\. The implementation supports configurable case strategies (including .NET-specific Pascal/Camel casing with acronym handling), optional lossless option encoding, and null-field skipping. It covers a wide range of F\# and .NET types, including records, unions, lists, arrays, sets, maps, enums, and \System.Uri\, with platform-specific optimizations for both .NET (using reflection caching) and Fable (using inline generation).

packages/Thoth.Json.Core.Auto · high confidence

New build system commands for benchmarking, documentation, testing, and publishing

The build system now includes new CLI commands implemented in F\# using Spectre.Console.CLI. Users can run benchmarks via the new Benchmark command, manage documentation sites (build, check, clean, deploy, watch) with configurable ports and host options, execute tests for JavaScript, TypeScript, Python, Newtonsoft, System.Text.Json, and legacy targets with watch mode support, and publish Thoth.Json packages to NuGet.

build/Commands · high confidence

New declarative codec builders for records and union types

Thoth.Json.Core now provides \objectCodec\ and \variantCodec\ (including \variantCodecWithTag\ and \variantCodecTuple\) computation-expression builders that let you define encoders and decoders for records and discriminated unions in a single, declarative block. These builders automatically generate both the encoding and decoding logic for fields or union cases, keeping the two in sync and simplifying the API for common serialization patterns.

Thoth.Json.Core · high confidence

Removals

The core decoding implementation (src/Decode.fs), extra type support (src/Extra.fs), release notes, and dependency references (paket.references) have been deleted from the src directory. This change removes the existing JSON decoding logic and associated helper modules from this location, likely as part of a restructuring or migration where these components are being replaced or moved.

src · high confidence

Removed legacy test suite and build configuration

The previous test infrastructure has been removed, including the main test runner (Main.fs), the specific JSON decode and encode test modules (Tests.Json.Decode.fs, Tests.Json.Encode.fs), the testing utility helpers (Util.fs), and the JavaScript build configuration (splitter.config.js) along with its package references. This cleanup eliminates the old Fable-based test execution path and associated build artifacts.

tests · high confidence

Architecture

Repository restructured with new build system and multi-target support

The project has been restructured to support .NET, JavaScript, and Python targets, introducing new packages such as Thoth.Json.Core, Thoth.Json.Core.Auto, Thoth.Json.JavaScript, Thoth.Json.Python, Thoth.Json.Newtonsoft, and Thoth.Json.System.Text.Json. The legacy FAKE-based build system (build.fsx, build.proj) has been replaced by a new dotnet-tool-based system (EasyBuild) and a uv.lock file for Python dependencies. Configuration files like .markdownlint.json, .node-version, and .python-version have been added, and the old CHANGELOG.md has been removed.

(repo-wide) · high confidence

Behavioural changes

Automated code formatting and commit message linting on commit

The repository now enforces code quality standards automatically before changes are committed. On pre-commit, staged F\# files are formatted using Fantomas and the CHANGELOG.md is linted using markdownlint-cli. Additionally, commit messages are validated against a custom linter (commit-linter) to ensure they meet project standards.

.husky · high confidence

Decimal decoding now uses invariant culture

The JSON decoder for decimal values now parses strings using invariant culture, ensuring consistent behavior regardless of the user's system locale settings. This change fixes issue \#245, where decimal strings were previously interpreted according to local formatting rules, potentially causing decoding failures or incorrect values on systems with different number formats.

packages/Thoth.Json · high confidence

New CLI-based build system with multi-target test support

The repository now uses a new F\#-based build tool (EasyBuild) driven by Spectre.Console.CLI, replacing the previous setup. This introduces structured commands for running tests across multiple targets (JavaScript, Newtonsoft, System.Text.Json, Python, TypeScript, and legacy), building and deploying documentation, running .NET benchmarks, and publishing packages. The build system also integrates Husky for pre-commit hooks and provides a workspace abstraction for managing project paths.

build · high confidence

Removal of legacy Paket MSBuild integration files

The project has removed the \.paket/Paket.Restore.targets\ MSBuild targets file and the \.paket/paket.exe.config\ configuration file. This change eliminates the legacy bootstrapping and restore logic that previously relied on a local \paket.exe\ binary, aligning with the project's shift to using the \dotnet paket\ global tool for dependency management.

.paket · high confidence

Test coverage

Added JavaScript test runner for Thoth.Json; Added Python test suite for Thoth.Json; Added comprehensive test coverage for Thoth.Json encoding and decoding; Added comprehensive test suite for Thoth.Json.Core codecs and decoders; Added legacy test suite for JSON decoders and encoders; Added legacy test suite for JSON serialization; Added tests for Newtonsoft.Json backend customization and deep JSON handling; Added tests for System.Text.Json backend integration; Added tests for primitive and variant JSON codecs.

Dependencies

Migrate to .NET SDK-style projects and central package management

The project has replaced the legacy Paket dependency manager and old-style .fsproj files with modern .NET SDK-style project files and a centralized version management system via Directory.Packages.props. This change standardizes dependency declarations across all packages (Thoth.Json.Core, Thoth.Json.Newtonsoft, Thoth.Json.System.Text.Json, Thoth.Json.Python, Thoth.Json.JavaScript, and Thoth.Json.Core.Auto), tests, and build tools, ensuring consistent versioning and simplifying maintenance. Key dependencies like Fable.Core, FSharp.Core, and Newtonsoft.Json are now managed centrally, and the build system has been updated to use .NET 10.0 targets where applicable.

(dependencies) · 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 65.

Lenses

  • Code Health 79
  • Architecture 99
  • Maturity 62
  • Readiness 58
  • Security 75

Changes since last survey

  • 300 commits — 263 feature/other, 37 fixes

By area

  • (root) — 88 commits
  • (repo) — 49 commits
  • packages/Thoth.Json.Core — 33 commits
  • docs/documentation — 15 commits
  • .github/workflows — 13 commits
  • src/Decode.fs — 12 commits
  • packages/Thoth.Json.System.Text.Json — 10 commits
  • packages/Thoth.Json — 8 commits
  • tests/Thoth.Json.Tests — 8 commits
  • .config/dotnet-tools.json — 6 commits
  • tests/Decoders.fs — 5 commits
  • build/Test — 4 commits
  • packages/Thoth.Json.Python — 4 commits
  • benchmarks/dotnet — 3 commits
  • docs/content — 3 commits
  • packages/Thoth.Json.Core.Auto — 3 commits
  • packages/Thoth.Json.Newtonsoft — 3 commits
  • .paket/Paket.Restore.targets — 2 commits
  • docs/Docs.fsproj — 2 commits
  • docs/_site — 2 commits

Notable commits

  • fix: Add CultureInvariant for decimal :bug:
  • fix: Fix #144: Auto coders for nesed anon records
  • fix: Fix CultureInfo issue in newtonsoft :bug:
  • fix: Fix Github link
  • fix: Fix link
  • fix: Fix path when auto decoding unions
  • fix: Fix representation of sbyte, byte, int16, uint16
  • fix: Fix snippet
  • fix: Fix the tests + rename the function
  • fix: Fix type in error message for unsupported Enum types
  • fix: Fix warning about ref usage
  • fix: Improve test formatting, fix wrong order :bug:
  • fix: Merge pull request #145 from alfonsogarciacaro/fix-144
  • fix: Merge pull request #193 from thoth-org/fix/ci
  • fix: Try fix publish workflow
  • fix: Workaround Fable bug for CI
  • fix: chore: fix benchmark code and update the results
  • fix: chore: fix benchmark to run against valid JSON
  • fix: chore: upgrade EasyBuild.Tools to fix the tag support
  • fix: ci: fix EasyBuild project by removing an old open statement
  • …and 280 more

Architecture

  • 0 containers · 6 bounded contexts · 4 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

thoth-org/Thoth.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 17 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 e90f5268764ec4bd0fc5c2ce594bdfa2f50353ff — the exact code this score is about.
  • Scored under rubric-2026.09.13 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-d1ef6c0bd534.