Purview.Results.ZodSharp.AspNetCore
1.0.0-prerelease.1
See the version list below for details.
dotnet add package Purview.Results.ZodSharp.AspNetCore --version 1.0.0-prerelease.1
NuGet\Install-Package Purview.Results.ZodSharp.AspNetCore -Version 1.0.0-prerelease.1
<PackageReference Include="Purview.Results.ZodSharp.AspNetCore" Version="1.0.0-prerelease.1" />
<PackageVersion Include="Purview.Results.ZodSharp.AspNetCore" Version="1.0.0-prerelease.1" />
<PackageReference Include="Purview.Results.ZodSharp.AspNetCore" />
paket add Purview.Results.ZodSharp.AspNetCore --version 1.0.0-prerelease.1
#r "nuget: Purview.Results.ZodSharp.AspNetCore, 1.0.0-prerelease.1"
#:package Purview.Results.ZodSharp.AspNetCore@1.0.0-prerelease.1
#addin nuget:?package=Purview.Results.ZodSharp.AspNetCore&version=1.0.0-prerelease.1&prerelease
#tool nuget:?package=Purview.Results.ZodSharp.AspNetCore&version=1.0.0-prerelease.1&prerelease
Purview.Results.ZodSharp.AspNetCore
Renders a result failure that carries ZodSharp validation errors as an ASP.NET Core
HttpValidationProblemDetails response, produced by the same mapper the ZodSharp exception handler uses — so a
validation failure carried by a result and the same failure thrown as a ZodException produce identical
responses.
Installation
dotnet add package Purview.Results.ZodSharp.AspNetCore
Quick start
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddZodSharpProblemDetails();
builder.Services.AddResultsHttp();
builder.Services.AddResultsZodSharpHttp();
var app = builder.Build();
app.MapPost("/reconcile", (ReconciliationRequest request) => Reconcile(request)).WithResultsHttp();
AddResultsZodSharpHttp registers the mapping as a fallback, so a mapping the host registered for a
specific error case always wins, and a mapping registered for the error type still wins over it.
API
| Member | Purpose |
|---|---|
AddResultsZodSharpHttp() |
Registers the ZodSharp options and adds the validation-problem fallback to ResultsHttpOptions |
IValidationErrorCarrier.ToValidationProblem(HttpContext, int statusCode = 400) |
Creates the validation problem for the errors the error value carries |
ImmutableArray<ValidationError>.ToValidationProblem(HttpContext, int statusCode = 400) |
Creates the validation problem for a set of errors |
ZodValidationProblems.ToProblem(errors, options, defaultStatusCode = 400, traceId = null) |
The underlying mapper, for hosts that resolve the options themselves |
The status code resolved by ZodProblemDetailsOptions.StatusCodeSelector wins; statusCode (or
defaultStatusCode) is only used when the resolved error type does not define one. The trace identifier is
included when ResultsHttpOptions.IncludeTraceId is true (the default).
Related packages
| Package | Purpose |
|---|---|
Purview.Results.ZodSharp |
Produces the results that carry validation errors |
Purview.Results.AspNetCore |
The result-to-response mapping this package extends |
Agent skills
This package ships the purview-results-zodsharp-problems agent skill under .agents/. Repositories that import
Purview.BuildSdk get it mirrored into their own .agents/ folder on the next restore or build, so AI agents
working there receive the guidance automatically.
License
MIT — see LICENSE.md.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Purview.Results.AspNetCore (>= 1.0.0-prerelease.1)
- Purview.Results.ZodSharp (>= 1.0.0-prerelease.1)
- Purview.ZodSharp.AspNetCore (>= 2.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.2 | 0 | 10/16/2026 |
| 1.0.0.1 | 86 | 10/8/2026 |
| 1.0.0 | 85 | 10/7/2026 |
| 1.0.0-prerelease.2 | 67 | 9/30/2026 |
| 1.0.0-prerelease.1 | 67 | 9/30/2026 |