PouryaKit.Web.OpenApi 0.1.0-preview.2

This is a prerelease version of PouryaKit.Web.OpenApi.
dotnet add package PouryaKit.Web.OpenApi --version 0.1.0-preview.2
                    
NuGet\Install-Package PouryaKit.Web.OpenApi -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="PouryaKit.Web.OpenApi" 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="PouryaKit.Web.OpenApi" Version="0.1.0-preview.2" />
                    
Directory.Packages.props
<PackageReference Include="PouryaKit.Web.OpenApi" />
                    
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 PouryaKit.Web.OpenApi --version 0.1.0-preview.2
                    
#r "nuget: PouryaKit.Web.OpenApi, 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 PouryaKit.Web.OpenApi@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=PouryaKit.Web.OpenApi&version=0.1.0-preview.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=PouryaKit.Web.OpenApi&version=0.1.0-preview.2&prerelease
                    
Install as a Cake Tool

PouryaKit.Web.OpenApi

NuGet .NET 10 License: MIT

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 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.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