Zorg.Json 0.1.0-preview.2

This is a prerelease version of Zorg.Json.
dotnet add package Zorg.Json --version 0.1.0-preview.2
                    
NuGet\Install-Package Zorg.Json -Version 0.1.0-preview.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Zorg.Json" Version="0.1.0-preview.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Zorg.Json" Version="0.1.0-preview.2" />
                    
Directory.Packages.props
<PackageReference Include="Zorg.Json" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Zorg.Json --version 0.1.0-preview.2
                    
#r "nuget: Zorg.Json, 0.1.0-preview.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Zorg.Json@0.1.0-preview.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Zorg.Json&version=0.1.0-preview.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Zorg.Json&version=0.1.0-preview.2&prerelease
                    
Install as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Zorg.Json:

Package Downloads
Zorg.Json.AspNetCore

ASP.NET Core integration for Zorg.Json: validate request bodies, return RFC 9457 problem details and serve JSON Schema documents.

Zorg.Json.Llm

Schema profiles for OpenAI, Anthropic and Gemini structured outputs, for Zorg.Json.

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 47 11/4/2026