Skip to content

Documentation

Corvus.Text.Json takes the core concepts from System.Text.Json—documents, elements, readers, writers—and reimagines them with pooled-memory parsing, mutable document building, and full JSON Schema validation, all driven by strongly-typed, source-generated models. These guides walk you through the core APIs and show how they relate to the System.Text.Json types you already know. New to the library? Start with the Getting Started tutorial, or jump straight to the Example Recipes for practical patterns you can use right away.

Parsing & Reading JSON

Parse JSON into read-only, strongly-typed models backed by pooled memory. A high-performance alternative to System.Text.Json's JsonDocument with generic type support and zero-copy element access.

Building & Mutating JSON

Create and modify JSON documents in-place with workspace-managed pooled memory. A builder-pattern alternative to System.Text.Json's JsonNode, designed for request/response cycles and data pipelines.

Source Generator

Generate strongly-typed C# from JSON Schema at build time with the Roslyn incremental source generator. Annotate a partial struct, register your schema, and get full IntelliSense immediately.

CLI Code Generation

Generate strongly-typed C# models from JSON Schema files using the `corvusjson` CLI tool. Same output as the source generator, for CI pipelines and pre-generation workflows.

Dynamic Schema Validation

Dynamically load, compile, and validate JSON documents against JSON Schema at runtime using Roslyn. Ideal for schema registries, configuration validation, and user-supplied schemas.

Migrating from V4

This guide helps you migrate code written against the V4 code generator (`Corvus.Json.CodeGeneration`, known informally as "Corvus.Json") to the V5 code generator (`Corvus.Text.Json.CodeGeneration`, known informally as "Corvus.Text.Json").

Copilot Migration

This guide shows you how to use GitHub Copilot (in VS Code, Visual Studio, or the CLI) to assist with migrating code from Corvus.Json (V4) to Corvus.Text.Json (V5).

Migration Analyzers

Complete reference for the Corvus.Text.Json migration analyzers — Roslyn diagnostics that detect V4 Corvus.Json patterns and guide you to V5 equivalents, with automatic code fixes for common transformations.

Analyzers

Built-in Roslyn analyzers and code fixes for Corvus.Text.Json — CTJ001 (prefer UTF-8 literals), CTJ002 (unnecessary conversions), CTJ003 (static match lambdas), and CTJ-NAV (navigate to JSON Schema source).

Standalone Schema Evaluator

Generate lightweight static evaluator classes for JSON Schema validation and annotation collection without creating full strongly-typed C# models. Ideal for validation-only workflows, full annotation gathering, and minimal footprint scenarios.

JSON Patch, Merge Patch & Diff

Apply RFC 6902 JSON Patch operations, RFC 7396 JSON Merge Patch, and compute diffs between documents. Build patches fluently with PatchBuilder, merge documents with ApplyMergePatch, or generate patches with CreatePatch.

JsonLogic Rule Engine

Evaluate JSON-encoded logic rules against JSON data using the interpreted evaluator, Roslyn source generator, or CLI code generator. Supports all standard JsonLogic operators, extended numeric types, and zero-allocation evaluation.

JSONata Query Language

Query and transform JSON data using the JSONata functional language. Supports interpreted evaluation, Roslyn source generator, and CLI code generation with 99.89% conformance and zero-allocation evaluation.

JMESPath Query Language

Query and extract data from JSON documents using the JMESPath query language. Supports interpreted evaluation, Roslyn source generator, and CLI code generation with zero-allocation evaluation.

YAML Converter

Convert YAML to JSON with a high-performance, zero-allocation converter supporting YAML 1.2 Core, JSON, Failsafe, and 1.1 compatibility schemas with 100% yaml-test-suite conformance.

JSON Canonicalization (JCS)

Produce a deterministic byte-exact serialization of JSON values using RFC 8785 JSON Canonicalization Scheme. Zero heap allocation on the hot path. Ideal for digital signatures, content hashing, and content-addressed storage.

JSONPath Query Language

Query and extract values from JSON documents using the JSONPath query language (RFC 9535). Supports interpreted evaluation, Roslyn source generator, and CLI code generation with zero-allocation evaluation.