PouryaKit.Web.OpenApi
0.1.0-preview.2
dotnet add package PouryaKit.Web.OpenApi --version 0.1.0-preview.2
NuGet\Install-Package PouryaKit.Web.OpenApi -Version 0.1.0-preview.2
<PackageReference Include="PouryaKit.Web.OpenApi" Version="0.1.0-preview.2" />
<PackageVersion Include="PouryaKit.Web.OpenApi" Version="0.1.0-preview.2" />
<PackageReference Include="PouryaKit.Web.OpenApi" />
paket add PouryaKit.Web.OpenApi --version 0.1.0-preview.2
#r "nuget: PouryaKit.Web.OpenApi, 0.1.0-preview.2"
#:package PouryaKit.Web.OpenApi@0.1.0-preview.2
#addin nuget:?package=PouryaKit.Web.OpenApi&version=0.1.0-preview.2&prerelease
#tool nuget:?package=PouryaKit.Web.OpenApi&version=0.1.0-preview.2&prerelease

PouryaKit.Web.OpenApi
API versions a Module declares, and one OpenAPI document for each. The Module declares its versions in its Composition Root, on Asp.Versioning's own version set, and each endpoint serves them on a versioned path and on the unversioned path, where a header selects the version. A deprecated version announces the sunset the Host configures, and the Scalar reference lists every document.
Install
dotnet add package PouryaKit.Web.OpenApi --prerelease
When to use it
- A Module's HTTP contract changes and existing clients must keep working.
- An endpoint exists only in some versions of its Module.
- You deprecate a version and announce the date it is meant to end.
- You serve one OpenAPI document per version and the Scalar reference over them.
It extends PouryaKit.Web. A Module that declares no version keeps the plain unversioned paths, in a Host with or without it; a Module that declares versions needs the Host to register it, or mapping its endpoints throws.
Quick start
Declare the Module's versions in its Composition Root, as the Proving Sample's Catalog does:
module.AddPouryaKitApiVersions(
"/catalog",
versions =>
versions
.HasDeprecatedApiVersion(new ApiVersion(1, 0))
.HasApiVersion(new ApiVersion(2, 0))
);
Register the versions and their documents in the Host, and map the documents:
builder.Services.AddPouryaKitOpenApi();
builder.Services.Configure<PouryaKitOpenApiOptions>(
builder.Configuration.GetSection("PouryaKit:OpenApi")
);
app.MapPouryaKitOpenApi().AllowAnonymous();
What you get
- Versions by URL segment and by header, on one endpoint.
- A deprecated version that announces its configured sunset.
- ASP.NET Core's own OpenAPI document for each version, and no Swagger generator.
- The Scalar API reference over them.
A version belongs to the Module, but its number is shared: versions of different Modules that share a number share one document and one sunset. A Module that joins a Host declares a version no other Module deprecates.
Learn more
| 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
- Asp.Versioning.Http (>= 10.2.3)
- Asp.Versioning.OpenApi (>= 10.2.3)
- Microsoft.AspNetCore.OpenApi (>= 10.0.13)
- PouryaKit.Web (>= 0.1.0-preview.2)
- Scalar.AspNetCore (>= 2.18.3)
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.1.0-preview.2 | 72 | 11/1/2026 |
| 0.1.0-preview.1 | 66 | 10/31/2026 |
| 0.1.0-preview.0.28 | 71 | 10/26/2026 |