Zorg.Json.AspNetCore
0.1.0-preview.2
dotnet add package Zorg.Json.AspNetCore --version 0.1.0-preview.2
NuGet\Install-Package Zorg.Json.AspNetCore -Version 0.1.0-preview.2
<PackageReference Include="Zorg.Json.AspNetCore" Version="0.1.0-preview.2" />
<PackageVersion Include="Zorg.Json.AspNetCore" Version="0.1.0-preview.2" />
<PackageReference Include="Zorg.Json.AspNetCore" />
paket add Zorg.Json.AspNetCore --version 0.1.0-preview.2
#r "nuget: Zorg.Json.AspNetCore, 0.1.0-preview.2"
#:package Zorg.Json.AspNetCore@0.1.0-preview.2
#addin nuget:?package=Zorg.Json.AspNetCore&version=0.1.0-preview.2&prerelease
#tool nuget:?package=Zorg.Json.AspNetCore&version=0.1.0-preview.2&prerelease
Zorg.Json
One fluent C# definition that validates raw JSON with precise error paths, gives you a typed result, and emits JSON Schema you can serve from an API. Inspired by Zod, idiomatic in .NET, depends only on System.Text.Json, and works with Native AOT.
This is a preview, and the API may change.
public sealed record Person(string Name, string? Nickname, int Age);
[JsonSerializable(typeof(Person))]
[JsonSourceGenerationOptions(JsonSerializerDefaults.Web)]
public sealed partial class AppJson : JsonSerializerContext;
static readonly ObjectSchema<Person> PersonSchema = Schema.Object(AppJson.Default.Person)
.Property(p => p.Name, s => s.Trim().MinLength(1).MaxLength(100))
.Property(p => p.Age, s => s.Minimum(0).Maximum(150));
ParseResult<Person> result = PersonSchema.SafeParse(json);
if (result.IsSuccess)
{
Console.WriteLine(result.Value.Name);
}
else
{
Console.WriteLine(result.Issues.ToPrettyString());
}
JsonObject schema = PersonSchema.ToJsonSchema(); // JSON Schema 2020-12
Without a .NET type, use the Zod-style builder:
ObjectSchema search = Z.Object()
.Property("query", Z.String().Trim().MinLength(1))
.Property("limit", Z.Integer().Minimum(1).Maximum(50).Default(10));
How this is built
Zorg.Json is written with the help of AI agents, mainly Claude Code from Anthropic. The maintainer sets the direction and makes the design decisions, and agents do most of the implementation. This note covers the whole project, so individual commits don't carry a co-author line.
Packages
| Package | Contents |
|---|---|
Zorg.Json |
Schemas, validation, JSON Schema emission and import, sample data |
Zorg.Json.AspNetCore |
Request validation with problem details, serving schemas, options validation |
Zorg.Json.AspNetCore.OpenApi |
Schemas in the OpenAPI document |
Zorg.Json.Llm |
OpenAI, Anthropic and Gemini structured output profiles |
JSON Schema Draft 2020-12 is the default output. Draft-07, OpenAPI 3.0 and OpenAPI 3.1 are also available. Import reads 2020-12, Draft-07, Draft-06 and Draft-04, and passes the official JSON-Schema-Test-Suite: every case passes, or its schema is refused at import with a stable error code. Every public member has XML documentation naming the JSON Schema keyword and the Zod equivalent.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Zorg.Json (>= 0.1.0-preview.2)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Zorg.Json.AspNetCore:
| Package | Downloads |
|---|---|
|
Zorg.Json.AspNetCore.OpenApi
Puts Zorg.Json schemas into the OpenAPI documents of Microsoft.AspNetCore.OpenApi. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-preview.2 | 0 | 11/5/2026 |
| 0.1.0-preview.1 | 43 | 11/4/2026 |