High-performance JSON for .NET
Source-generated strongly-typed C# from JSON Schema. Zero-allocation parsing, full validation for all drafts, mutable documents, JSONata, JMESPath, JSONPath, JsonLogic, YAML, JSON Patch, and more.
Built for performance-critical .NET
Every feature designed around zero-allocation, pooled-memory JSON processing
Source Generation
Roslyn incremental source generator or CLI tool produces strongly-typed C# from any JSON Schema. Type-safe accessors, validation, serialization — all from a single schema file.
Schema Validation
Full draft 4, 6, 7, 2019-09, and 2020-12 validation with EvaluateSchema(). Over 10x faster than other .NET validators. Detailed diagnostics for every failure.
Pooled Memory
ParsedJsonDocument<T> uses ArrayPool<byte> for minimal per-document allocation. Generated types are thin struct wrappers over pooled data.
Mutable Documents
JsonDocumentBuilder<T> with workspace-managed pooled memory. Ideal for request/response cycles and data pipelines. No per-node allocations.
Extended Types
BigNumber for arbitrary-precision decimals, NodaTime integration for dates, and zero-allocation UTF-8 URI types. Beyond what decimal offers.
Pattern Matching
Type-safe Match() for discriminated unions, allOf composition with From() conversion, and string/numeric enumerations with exhaustive dispatch.

JSONata
Full JSONata query and transformation language. 100% test-suite conformance with both interpreted and code-generated evaluation modes. Learn more →
JMESPath
Full JMESPath query language. 100% conformance with the official test suite, with interpreted and code-generated evaluation modes. Learn more →

JsonLogic
Complete JsonLogic rule engine for evaluating business rules against JSON data. Interpreted and code-generated modes with custom operator support. Learn more →
JSONPath
IETF-standardized RFC 9535 query language with recursive descent, filters, and custom function extensions. 100% conformance, interpreted and code-generated modes. Learn more →
JSON Patch
RFC 6902 JSON Patch with pooled-memory operations. Apply, generate, and diff patches on JsonElement without string allocations.
YAML
High-performance YAML 1.2 to JSON converter. 100% yaml-test-suite conformance with a zero-allocation ref struct tokenizer on UTF-8 bytes. Learn more →
From schema to strongly-typed C# in seconds
Define a JSON Schema, annotate a partial struct, and the source generator does the rest. You get typed properties, validation, serialization, mutation — and it all runs on pooled memory.
Get Started// 1. Annotate a partial struct
[JsonSchemaTypeGenerator("Schemas/person.json")]
public readonly partial struct Person;
// 2. Parse JSON — pooled memory, zero-copy
using var doc = ParsedJsonDocument<Person>.Parse(
"""{"name":"Alice","age":30}""");
Person person = doc.RootElement;
// 3. Access typed properties
string name = (string)person.Name; // "Alice"
int age = (int)person.Age; // 30
// 4. Validate against the schema
bool valid = person.EvaluateSchema(); // true
// 5. Mutate with the builder pattern
using var ws = JsonWorkspace.Create();
using var b = person.CreateBuilder(ws);
Person.Mutable root = b.RootElement;
root.SetAge(31);
// {"name":"Alice","age":31}
How it compares
| Feature | System.Text.Json | Corvus.Text.Json |
|---|---|---|
| Read-only Memory Model | ArrayPool-backed pooled memory | ArrayPool-backed pooled memory |
| Mutable Documents | JsonNode (allocates per node) | Builder pattern on the same pooled memory model — no data copying in JSON pipelines |
| Schema Validation | None built-in | Draft 4, 6, 7, 2019-09, and 2020-12 with full diagnostics. 10x+ faster than other .NET validators |
| Code Generation | Source generation for serialization to/from fixed .NET POCOs | Source generator + CLI tool producing strongly-typed entities with composition, pattern matching, and resilience to invalid schema |
| Date/Time Types | System.DateTime, DateTimeOffset | All .NET types (DateTime, DateOnly, TimeOnly where available) plus NodaTime (LocalDate, OffsetDateTime, Period) |
| Numeric Precision | decimal (28 digits); Int128, UInt128, Half via custom serializers | BigNumber (arbitrary precision) plus native Int128, UInt128, and Half support where available |
| Strings & URIs | Allocates .NET strings; System.Uri for URI handling | Allocation-free access to UTF-8 and UTF-16 unescaped strings; UTF-8 Uri/Iri with display and canonical formatting without string allocation |
Packages
Install the runtime and source generator to get started
Corvus.Text.Json
Core runtime library. Required by all generated types. Get started →
dotnet add package Corvus.Text.Json
Corvus.Text.Json.SourceGenerator
Roslyn incremental source generator. Generates C# at build time. Read the docs →
<PackageReference Include="Corvus.Text.Json.SourceGenerator">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Corvus.Text.Json.CodeGenerator
CLI tool for ahead-of-time code generation from JSON Schema. Read the docs →
dotnet tool install --global Corvus.Text.Json.CodeGenerator
Corvus.Text.Json.Validator
Dynamically load, compile, and validate JSON against JSON Schema at runtime. Read the docs →
dotnet add package Corvus.Text.Json.Validator
Corvus.Text.Json.Jsonata
JSONata query and transformation language for JSON. Interpreted and code-generated modes. Read the docs →
dotnet add package Corvus.Text.Json.Jsonata
Corvus.Text.Json.JMESPath
JMESPath query language for extracting and reshaping JSON data. Interpreted and code-generated modes. Read the docs →
dotnet add package Corvus.Text.Json.JMESPath
Corvus.Text.Json.JsonLogic
JsonLogic rule engine for evaluating business rules against JSON data. Read the docs →
dotnet add package Corvus.Text.Json.JsonLogic
Corvus.Text.Json.JsonPath
JSONPath (RFC 9535) query language with recursive descent, filters, and custom function extensions. Read the docs →
dotnet add package Corvus.Text.Json.JsonPath
Corvus.Text.Json.JsonPath.SourceGenerator
Roslyn source generator for compile-time JSONPath code generation from .jsonpath expression files. Read the docs →
<PackageReference Include="Corvus.Text.Json.JsonPath.SourceGenerator">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Corvus.Text.Json.Patch
RFC 6902 JSON Patch with pooled-memory operations on JsonElement.
dotnet add package Corvus.Text.Json.Patch
Corvus.Text.Json.Yaml
YAML 1.2 to JSON converter with full Corvus document model integration. Read the docs →
dotnet add package Corvus.Text.Json.Yaml
Corvus.Yaml.SystemTextJson
Lightweight YAML 1.2 to JSON converter using only System.Text.Json — no Corvus dependency required. Read the docs →
dotnet add package Corvus.Yaml.SystemTextJson
Ready to get started?
Install the tools, define your first JSON Schema, and generate strongly-typed C# in minutes.