SpecGuard 0.9.0-beta.3

This is a prerelease version of SpecGuard.
dotnet add package SpecGuard --version 0.9.0-beta.3
                    
NuGet\Install-Package SpecGuard -Version 0.9.0-beta.3
                    
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="SpecGuard" Version="0.9.0-beta.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SpecGuard" Version="0.9.0-beta.3" />
                    
Directory.Packages.props
<PackageReference Include="SpecGuard" />
                    
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 SpecGuard --version 0.9.0-beta.3
                    
#r "nuget: SpecGuard, 0.9.0-beta.3"
                    
#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 SpecGuard@0.9.0-beta.3
                    
#: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=SpecGuard&version=0.9.0-beta.3&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=SpecGuard&version=0.9.0-beta.3&prerelease
                    
Install as a Cake Tool

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)

License

MIT

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.

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