SpecGuard 0.9.0-beta.3
dotnet add package SpecGuard --version 0.9.0-beta.3
NuGet\Install-Package SpecGuard -Version 0.9.0-beta.3
<PackageReference Include="SpecGuard" Version="0.9.0-beta.3" />
<PackageVersion Include="SpecGuard" Version="0.9.0-beta.3" />
<PackageReference Include="SpecGuard" />
paket add SpecGuard --version 0.9.0-beta.3
#r "nuget: SpecGuard, 0.9.0-beta.3"
#:package SpecGuard@0.9.0-beta.3
#addin nuget:?package=SpecGuard&version=0.9.0-beta.3&prerelease
#tool nuget:?package=SpecGuard&version=0.9.0-beta.3&prerelease
SpecGuard
Drop-in ASP.NET Core middleware that validates incoming API requests against your OpenAPI specification.
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddOpenApi();
builder.Services.AddSpecGuard();
var app = builder.Build();
app.UseSpecGuard();
app.MapEndpoints();
app.MapOpenApi();
app.Run();
As long as the OpenAPI specification generated by your API is complete and correct, SpecGuard just works.
Why
SpecGuard validates JSON requests against the OpenAPI specification published by your API at runtime, producing error messages that refer to the actual JSON submitted by the client — with line/column numbers, JSON paths, and meaningful descriptions. Parameters outside the request body are validated too, with consistent error messages.
This prevents drift between the published specification and your validation logic, and helps you maintain a good OpenAPI specification.
Requirements
net10.0- ASP.NET Core's built-in OpenAPI stack (
Microsoft.AspNetCore.OpenApi)
Links
License
MIT
| 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
- JsonSchema.Net (>= 9.2.0)
- Microsoft.AspNetCore.OpenApi (>= 10.0.6)
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 |
|---|---|---|
| 0.9.0-beta.3 | 74 | 4/20/2026 |
| 0.9.0-beta.2 | 65 | 4/20/2026 |
| 0.9.0-beta.1 | 63 | 4/20/2026 |