Skip to content
CAI
Software that uses CAICheck a score

thoth-org/Thoth.Json

56.7

Adequate · 15 November 2026

9.2k

lines of production code

F#

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Add JavaScript decoder with ExactNumbers option

Introduces a new JavaScript-specific decoder implementation in Thoth.Json.JavaScript. Users can now parse JSON strings into F\# types using the \Decode.fromStringWithOptions\ function, which supports a new \DecodeOptions.ExactNumbers\ setting to preserve the original text representation of number literals during parsing, avoiding precision loss for large integers or floating-point values.

Thoth.Json.JavaScript · high confidence

Added .NET benchmark suite for JSON serialization performance

A new benchmark project has been added to measure and compare the performance of Thoth.Json against Newtonsoft.Json and System.Text.Json. The suite includes a User model decoder and runs benchmarks for Thoth.Json with both Newtonsoft and System.Text.Json backends, as well as the native Newtonsoft and System.Text.Json serializers, ordered from fastest to slowest.

Thoth.Json.DotNet.Benchmark · 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 during decoding, and formatting/indentation during encoding, replacing the previous fixed behavior.

packages/Thoth.Json.Newtonsoft · high confidence

Introduce System.Text.Json backend for Thoth.Json

Adds a new \Thoth.Json.System.Text.Json\ package that provides decoders and encoders built on top of .NET's \System.Text.Json\. This allows users to parse and generate JSON using the native System.Text.Json engine while retaining Thoth.Json's decoder/encoder API. The implementation includes helpers to map \JsonElement\ and \JsonNode\ types to Thoth's core abstractions, supports passing custom \JsonDocumentOptions\ for decoding (e.g., to allow trailing commas or increase max depth), and allows passing \JsonSerializerOptions\ for encoding (e.g., for indentation and escaping control).

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

Introduce Thoth.Json.Core.Auto API for automatic JSON serialization

This change adds the Thoth.Json.Core.Auto package, providing an automatic JSON serialization API that handles record fields and union cases with configurable naming strategies (SnakeCase, PascalCase, etc.). It includes a caching mechanism to avoid redundant code generation and allows users to register custom coders for specific types (such as int64, uint64, decimal, and bigint) via the ExtraCoders configuration.

Thoth.Json.Core.Auto · high confidence

Introduce Thoth.Json.Python for Python target support

This change adds the \Thoth.Json.Python\ package, enabling F\# code using Thoth.Json to compile and run on the Python target via Fable. It provides Python-specific encoder and decoder implementations (\Encode.fs\, \Decode.fs\) that map F\# types to Python objects (using \Fable.Python\ interop) and utilize Python's standard \json\ module for serialization. The implementation supports encoding/decoding strings, numbers, booleans, arrays, and objects, with specific handling for non-ASCII characters (emitted as-is via \ensureAscii = false\) and proper type checking for Python's bool/int hierarchy.

packages/Thoth.Json.Python · high confidence

Introduce auto-generated JSON codecs for F\# types

The \Thoth.Json.Core.Auto\ package now provides automatic JSON encoding and decoding for F\# types via the \Codec.Auto.generateCodec\ function. This feature eliminates the need for manual encoder/decoder definitions by using reflection to handle common types, including support for \System.Uri\, \DateTime\, and \DateTimeOffset\. Users can configure the generated codecs with options such as \caseStrategy\ for property naming conventions, \extra\ coders for custom types, \skipNullField\ to omit null values, and \losslessOption\ to preserve \Some\ values in JSON arrays.

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

Introduce core codec abstraction and decoder computation expression

Thoth.Json.Core now provides a unified \Codec\<'T\>\ type that pairs an encoder and a decoder, along with a set of pre-built codecs for primitive types (string, int, float, Guid, Uri, etc.), options (\lossyOption\, \losslessOption\), and recursive structures (\Codec.fix\). A new decoder Computation Expression (\decoder { ... }\) allows composing decoders using \let!\ and \and!\ syntax, and an \objectCodec\ builder simplifies creating codecs for records. This core layer is designed to be runtime-agnostic, relying on \IDecoderHelpers\ and \IEncoderHelpers\ interfaces to support multiple JSON backends.

packages/Thoth.Json.Core · high confidence

Major project restructuring and multi-target support

The repository has been restructured to support multiple runtime targets (.NET, JavaScript, and Python) with a new modular package structure. The solution now includes distinct packages for the core API (\Thoth.Json.Core\), auto-coders (\Thoth.Json.Core.Auto\), and specific runtimes (\Thoth.Json.JavaScript\, \Thoth.Json.Python\, \Thoth.Json.Newtonsoft\, \Thoth.Json.System.Text.Json\). The build system has been migrated from FAKE scripts to a .NET tool-based approach (\EasyBuild\), and the project now uses .NET SDK 10.0 with central package management. Additionally, Python support is introduced via a new \Thoth.Json.Python\ package and associated test runners.

(repo-wide) · high confidence

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

The build system now includes dedicated CLI commands for running .NET benchmarks, managing documentation sites (build, check, clean, deploy, and watch with custom port/host options), executing test suites for JavaScript, TypeScript, Python, Newtonsoft, and System.Text.Json targets, and publishing Thoth.Json packages to NuGet.

build/Commands · high confidence

New variant union case encoding codecs

Thoth.Json.Core now includes new builder functions (\variantCodec\, \variantCodecWithTag\, and \variantCodecTuple\) that allow users to define custom JSON encoders and decoders for discriminated unions. These tools support three distinct serialization formats: writing the tag and value as separate object properties, encoding the union case as a two-element array, or using a single-key object where the key is the case name.

Thoth.Json.Core · high confidence

Removals

Removal of legacy src/Decode.fs and Extra.fs modules

The legacy \src/Decode.fs\ and \src/Extra.fs\ files have been deleted from the source tree. This change removes the previous implementations of the core decoding logic, helper modules, and extra type coders (such as \int64\, \uint64\, \decimal\, and \bigint\ support) that were previously exposed in the \Thoth.Json\ and \Thoth.Json.Extra\ namespaces. Users relying on these specific files for manual decoding or extended type support will need to migrate to the new implementation structure replacing them.

src · high confidence

Removed legacy test suite and build infrastructure

The previous test suite, including \Tests.Json.Decode.fs\, \Tests.Json.Encode.fs\, and the \Main.fs\ runner, has been deleted along with the \Util.fs\ testing helpers and the \splitter.config.js\ build configuration. This removes the old Fable-based test execution path and its associated dependencies (\FSharp.Core\, \Fable.Core\) from the \tests\ directory.

tests · 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

Re-structure Thoth.Json project layout and add legacy support

The Thoth.Json source files have been reorganized from the src directory into a packages/Thoth.Json structure, and the build system now supports legacy project configurations. Additionally, minor code style adjustments were applied to the Types module, including formatting changes to the ExtraCoders record and whitespace updates in the Util module.

Thoth.Json · medium 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 suite using Scriptorium; Added Python test suite for Thoth.Json; Added System.Text.Json backend test suite; Added comprehensive test coverage for Thoth.Json; Added legacy test suite for JSON decoders and encoders; Added legacy test suite for JSON serialization; Added test coverage for primitive and variant JSON codecs; Added tests for Newtonsoft.Json backend customization and codec support; Migrate test suite to Scriptorium and add comprehensive Codec tests.

Dependencies

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

The project has transitioned from the legacy Paket dependency manager to standard .NET SDK-style .fsproj files and introduced central package management via Directory.Packages.props. This change consolidates version definitions for key dependencies such as Fable.Core (5.0.0), FSharp.Core (10.1.203), and Newtonsoft.Json (13.0.1) in a single location, while removing the old paket.dependencies and paket.lock files. The migration also updates the build and documentation tooling to target .NET 10.0 and adopt modern SDK patterns.

(dependencies) · 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 57 → 57 (-0.5)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.

Lenses

  • Code Health 83 → 72 (-11.1)
  • Architecture 100 → 100 (+0.0)
  • Maturity 62 → 65 (+3.6)
  • Readiness 41 → 41 (+0.0)
  • Security 78 → 70 (-8.6)
  • Performance 75 → 80 (+4.6)

Resolved (4)

  • Hotspot: packages/Thoth.Json.Core.Auto/Decode.fs (packages/Thoth.Json.Core.Auto/Decode.fs)
  • IL efficiency: 6 authored method(s) exceed the IL budget (packages/Thoth.Json/Encode.fs)
  • No ADRs found
  • Off-boarding risk: anonymized user #1

New (2)

  • No ADRs found (docs/Docs.fsproj)
  • Off-boarding risk: anonymized user #1

Architecture

  • Unchanged — 0 containers · 7 contexts · 5 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

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 15 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 58b82233a1539863d09a1103c6fcc373c8a79739 — the exact code this score is about.
  • Scored under rubric-2026.11.4 — 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.65+preprod-3c33c1882dc1.