支持 Json Schema 验证和实体生成
High-performance, source-generated, strongly-typed C# models from JSON Schema — with pooled-memory parsing, full draft 4 through 2020-12 validation, and 136B per-document allocation.
corvusjson CLI tool.ParsedJsonDocument uses ArrayPool for minimal GC impact. Just 136 bytes per-document allocation.JsonDocumentBuilder and JsonWorkspace provide a builder pattern for creating and modifying JSON with pooled workspace memory.BigNumber for arbitrary-precision decimals, BigInteger for large integers, plus NodaTime integration for date, date-time, time, and duration formats.Match() for oneOf/anyOf discriminated unions with exhaustive dispatch.JsonElement.ref struct tokenizer.…Most applications need Corvus.Text.Json plus either the source generator or the corvusjson CLI. Add the feature-specific runtime packages you use.
| Area | Package | Description |
|---|---|---|
| Core runtime | Corvus.Text.Json | Core V5 runtime library. Required by all V5 generated types. |
| JSON Schema generation | Corvus.Text.Json.SourceGenerator | Roslyn incremental source generator for JSON Schema model generation at build time. |
| JSON Schema generation | Corvus.Text.Json.CodeGeneration | Shared JSON Schema code-generation engine for tools and advanced extension scenarios. |
| JSON Schema generation | Corvus.Json.Cli | CLI tool (corvusjson) for ahead-of-time JSON Schema, OpenAPI, AsyncAPI, and query-language code generation. |
| JSON Schema generation | Corvus.Json.CodeGenerator | Immutable-model CLI tool (generatejsonschematypes). Delegates to the same engines; defaults to V4. |
| Dynamic validation | Corvus.Text.Json.Validator | Load and validate JSON against JSON Schema at runtime with the runtime evaluator: no code generation, millisecond cold start. |
| Compatibility | Corvus.Text.Json.Compatibility | Bridge helpers for interop with V4 Corvus.Json.ExtendedTypes and System.Text.Json during migration. |
| Migration | Corvus.Text.Json.Migration.Analyzers | Roslyn analyzers and code fixes for migrating V4 Corvus.Json code to V5 Corvus.Text.Json. |
| OpenAPI | Corvus.Text.Json.OpenApi | Runtime abstractions for generated OpenAPI clients and ASP.NET Core server stubs. |
| OpenAPI | Corvus.Text.Json.OpenApi.HttpTransport | HttpClient transport for generated OpenAPI clients. |
| OpenAPI | Corvus.Text.Json.OpenApi.CodeGeneration | Code-generation engine for OpenAPI and related API-generation tooling. |
| OpenAPI | Corvus.Text.Json.OpenApi20 | Strongly-typed V5 model types for OpenAPI 2.0 (Swagger) documents. |
| OpenAPI | Corvus.Text.Json.OpenApi30 | Strongly-typed V5 model types for OpenAPI 3.0 documents. |
| OpenAPI | Corvus.Text.Json.OpenApi31 | Strongly-typed V5 model types for OpenAPI 3.1 documents. |
| OpenAPI | Corvus.Text.Json.OpenApi32 | Strongly-typed V5 model types for OpenAPI 3.2 documents. |
| AsyncAPI | Corvus.Text.Json.AsyncApi | Runtime support for generated AsyncAPI producers, consumers, handlers, and request/reply flows. |
| AsyncAPI | Corvus.Text.Json.AsyncApi.CodeGeneration | Code-generation engine for AsyncAPI producer/consumer generation. |
| AsyncAPI | Corvus.Text.Json.AsyncApi26 | Strongly-typed V5 model types for AsyncAPI 2.6 documents. |
| AsyncAPI | Corvus.Text.Json.AsyncApi30 | Strongly-typed V5 model types for AsyncAPI 3.0 documents. |
| AsyncAPI transports | Corvus.Text.Json.AsyncApi.Nats | NATS transport for generated AsyncAPI applications. |
| AsyncAPI transports | Corvus.Text.Json.AsyncApi.Kafka | Kafka transport for generated AsyncAPI applications. |
| AsyncAPI transports | Corvus.Text.Json.AsyncApi.Amqp | AMQP 0-9-1/RabbitMQ transport for generated AsyncAPI applications. |
| AsyncAPI transports | Corvus.Text.Json.AsyncApi.Mqtt | MQTT 3.1.1/5.0 transport for generated AsyncAPI applications. |
| AsyncAPI transports | Corvus.Text.Json.AsyncApi.WebSocket | WebSocket transport for generated AsyncAPI applications. |
| AsyncAPI transports | Corvus.Text.Json.AsyncApi.AzureServiceBus | Azure Service Bus transport for generated AsyncAPI applications. |
| AsyncAPI support | Corvus.Text.Json.AsyncApi.Testing | In-memory transport for testing generated AsyncAPI producers and consumers. |
| AsyncAPI support | Corvus.Text.Json.AsyncApi.HealthChecks | ASP.NET Core health checks for AsyncAPI transports. |
| AsyncAPI support | Corvus.Text.Json.AsyncApi.Polly | Polly-based resilience middleware for AsyncAPI handlers/transports. |
| JSONata | Corvus.Text.Json.Jsonata | JSONata query and transformation evaluator. |
| JSONata | Corvus.Text.Json.Jsonata.SourceGenerator | Roslyn source generator for compile-time JSONata code generation. |
| JSONata | Corvus.Text.Json.Jsonata.CodeGeneration | Code-generation engine for JSONata expressions. |
| JMESPath | Corvus.Text.Json.JMESPath | JMESPath query-language evaluator. |
| JMESPath | Corvus.Text.Json.JMESPath.SourceGenerator | Roslyn source generator for compile-time JMESPath code generation. |
| JMESPath | Corvus.Text.Json.JMESPath.CodeGeneration | Code-generation engine for JMESPath expressions. |
| JsonLogic | Corvus.Text.Json.JsonLogic | JsonLogic rule engine. |
| JsonLogic | Corvus.Text.Json.JsonLogic.SourceGenerator | Roslyn source generator for compile-time JsonLogic code generation. |
| JsonLogic | Corvus.Text.Json.JsonLogic.CodeGeneration | Code-generation engine for JsonLogic rules. |
| JSONPath | Corvus.Text.Json.JsonPath | JSONPath (RFC 9535) query-language evaluator. |
| JSONPath | Corvus.Text.Json.JsonPath.SourceGenerator | Roslyn source generator for compile-time JSONPath code generation. |
| JSONPath | Corvus.Text.Json.JsonPath.CodeGeneration | Code-generation engine for JSONPath expressions. |
| JSON Patch | Corvus.Text.Json.Patch | RFC 6902 JSON Patch, RFC 7396 Merge Patch, and diff. |
| YAML | Corvus.Text.Json.Yaml | YAML 1.2 to JSON converter with Corvus document model integration. |
| YAML | Corvus.Yaml.SystemTextJson | YAML 1.2 to JSON converter using only System.Text.Json. |
| TOON | Corvus.Text.Json.Toon | TOON to JSON and JSON to TOON converter with Corvus document model integration. |
| TOON | Corvus.Toon.SystemTextJson | TOON to JSON and JSON to TOON converter using only System.Text.Json. |
# Core library
dotnet add package Corvus.Text.Json
# CLI code generator
dotnet tool install --global Corvus.Json.CliFor the source generator, add as an analyzer reference:
all
runtime; build; native; contentfiles; analyzers; buildtransitive
Note: .NET 8.0 is not supported on the V5 engine. The V4 engine will drop .NET 8.0 support in November 2026 when it reaches end-of-life.
Full documentation is available at the Corvus.Text.Json documentation website.
To build and preview the docs locally:
cd docs/website
./preview.ps1Then open http://localhost:5000.
dotnet build Corvus.Text.Json.slnxdotnet test Corvus.Text.Json.slnx --filter "category!=failing&category!=outerloop"| Feature | System.Text.Json | Corvus.Text.Json |
|---|---|---|
| Read-only parsing | JsonDocument (pooled) |
ParsedJsonDocument (pooled, generic) |
| Mutable documents | JsonNode (allocates per node) |
Builder pattern on pooled memory |
| Schema validation | None built-in | Draft 4/6/7/2019-09/2020-12 with full diagnostics |
| Code generation | Serialization to/from POCOs | Strongly-typed entities from JSON Schema |
| Date/Time | DateTime, DateTimeOffset |
All .NET types plus NodaTime |
| Numeric precision | decimal (28 digits) |
BigNumber (arbitrary precision), Int128, Half |
| String/URI handling | .NET string allocation | Zero-allocation UTF-8/UTF-16 access |
Corvus.Text.Json.Jsonata implements JSONata — an expressive, Turing-complete functional query and transformation language for JSON. It supports path navigation, predicate filtering, higher-order functions ($map, $filter, $reduce, $sort), object construction, string manipulation, arithmetic, regular expressions, and user-defined functions.
暂无开放 Issues,或尚未同步最近议题。