Skip to content
CAI
Software that uses CAICheck a score

fsprojects/FSharp.Data.JsonSchema

61.8

Adequate · 3 October 2026

1.9k

lines of production code

F#

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is an F\# library that generates JSON Schema and OpenAPI documentation from F\# type definitions. It provides core analysis infrastructure for complex types like discriminated unions and recursive structures, with adapters to output schemas via NJsonSchema and ASP.NET Core OpenAPI middleware. The project has been restructured into modular packages to improve maintainability and includes comprehensive testing for schema accuracy and serialization roundtrips.

Features

Introduce NJsonSchema adapter for F\# schema generation

Adds a new implementation layer in \src/FSharp.Data.JsonSchema.NJsonSchema\ that bridges the core schema analysis with the NJsonSchema library. This includes \NJsonSchemaTranslator.fs\ to convert internal schema nodes into NJsonSchema objects (handling references, primitives, and nullable types), \JsonSchema.fs\ containing obsolete schema processors for legacy F\# type handling (options, single-case discriminated unions, and multi-case unions), and \Serializer.fs\ which provides a unified API for serializing and deserializing F\# types using System.Text.Json with specific F\#-aware options (such as union tagging and option unwrapping). The module depends on NJsonSchema, FSharp.Core, and FSharp.SystemTextJson.

src/FSharp.Data.JsonSchema.NJsonSchema · high confidence

Introduce Spec-Driven Development workflow with automation scripts and templates

This change establishes a structured Spec-Driven Development workflow by adding a project constitution, a suite of Bash automation scripts, and Markdown templates for feature specifications, implementation plans, and task lists. The new scripts in \.specify/scripts/bash/\ (including \check-prerequisites\, \create-new-feature\, \setup-plan\, and \update-agent-context\) automate the creation of feature branches, generation of implementation plans from templates, and synchronization of AI agent context files. The added templates (\spec-template\, \plan-template\, \tasks-template\, \checklist-template\, \agent-file-template\) define the required structure for feature documentation, while the constitution file sets project standards for API design, dependency management, and testing.

.specify · high confidence

Introduce core schema analysis infrastructure for F\# types

Added the core library files (SchemaAnalyzer.fs, SchemaGeneratorConfig.fs, SchemaNode.fs) that define the intermediate representation for JSON schemas and the logic to analyze F\# types. This includes support for discriminated unions (with internal, adjacent, external, and untagged encoding styles), anonymous records, Choice types, option types, and various collection types, along with configuration options for naming policies, discriminator properties, and field requirements.

src/FSharp.Data.JsonSchema.Core · high confidence

Security

Security patches for transitive dependencies and package restructuring

This update addresses three security vulnerabilities in transitive dependencies by pinning specific versions: System.Text.Json is pinned to 6.0.10 for netcoreapp3.1 and 8.0.6 for other targets to mitigate [GHSA redacted] (denial of service in JsonSerializer); Newtonsoft.Json is pinned to 13.0.3 to address [GHSA redacted]; and Microsoft.OpenApi is pinned to 2.9.0 for net10.0 to prevent stack overflow parsing circular schema refs ([GHSA redacted]). Additionally, the library has been restructured into separate packages (Core, NJsonSchema, OpenApi) with the original package marked as deprecated, and FSharp.SystemTextJson is updated to version 1.1.23.

(dependencies) · high confidence

Behavioural changes

FSharp.Data.JsonSchema package renamed to FSharp.Data.JsonSchema.NJsonSchema

The FSharp.Data.JsonSchema package has been renamed to FSharp.Data.JsonSchema.NJsonSchema. A new compatibility shim has been introduced in the original package location that marks the module as obsolete and directs users to update their package references to the new name. The original package will not receive updates beyond version 3.0.0.

src/FSharp.Data.JsonSchema · high confidence

FSharp.Data.JsonSchema v3.1.0: Fixes for OpenAPI component collisions and format-annotated types

This release addresses several critical issues in the OpenAPI schema generation for F\# types. Discriminated unions and self-recursive types no longer cause \InvalidOperationException\ or generate dangling component references on .NET 10; instead, component schemas are correctly registered in the live \OpenApiDocument\ with unique, qualified IDs (e.g., \TreeNode.Leaf\) to prevent collisions. Format-annotated primitives like \DateTime\ and \Guid\ are now inlined directly into the schema rather than creating unnecessary \$ref\ components. Additionally, the \Microsoft.OpenApi\ dependency for .NET 10 is pinned to version 2.9.0 to address security vulnerabilities.

(repo-wide) · high confidence

Fixes

Fix OpenAPI schema generation for F\# types on .NET 10

The F\# Data JsonSchema library now correctly generates OpenAPI schemas for F\# records and unions when running on .NET 10. This update resolves issues where component schemas were not properly registered in the live OpenAPI document, leading to dangling references and missing definitions. It also inlines format-annotated primitives to prevent unnecessary component clutter and ensures distinct component IDs for types with similar case names, improving the accuracy and completeness of the generated API documentation.

src/FSharp.Data.JsonSchema.OpenApi · high confidence

Test coverage

Added comprehensive test suite for F\# JSON schema generation and serialization; Added end-to-end and integration tests for OpenAPI schema generation; Added specification and design contracts for the Core Extraction and Multi-Target Architecture feature.

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

Score

  • CAI 61 → 62 (+0.8)
  • Rubric changed (rubric-2026.09.15 → rubric-2026.10.1) — scores are not directly comparable.

Lenses

  • Code Health 58 → 58 (+0.0)
  • Architecture 66 → 78 (+12.3)
  • Maturity 65 → 65 (-0.1)
  • Readiness 58 → 58 (+0.0)
  • Security 83 → 80 (-3.3)

Resolved (1)

  • Documentation: contradicts the code (docs/superpowers/plans/2026-07-25-openapi-dangling-schema-ref-fix.md)

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

fsprojects/FSharp.Data.JsonSchema 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 3 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit a55d7874f6c89f350f8ec95dc30ae02ceda7abef — the exact code this score is about.
  • Scored under rubric-2026.10.1 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-4f4226d619ea.