SwaggerUi.OpenApi
0.3.0
See the version list below for details.
dotnet add package SwaggerUi.OpenApi --version 0.3.0
NuGet\Install-Package SwaggerUi.OpenApi -Version 0.3.0
<PackageReference Include="SwaggerUi.OpenApi" Version="0.3.0" />
paket add SwaggerUi.OpenApi --version 0.3.0
#r "nuget: SwaggerUi.OpenApi, 0.3.0"
// Install SwaggerUi.OpenApi as a Cake Addin #addin nuget:?package=SwaggerUi.OpenApi&version=0.3.0 // Install SwaggerUi.OpenApi as a Cake Tool #tool nuget:?package=SwaggerUi.OpenApi&version=0.3.0
SwaggerUi.OpenApi
A package to simplify adding Swagger UI to .NET 9's Microsoft.AspNetCore.OpenApi.
Usage
In your Program.cs
file Add app.MapSwaggerUi()
after app.MapOpenApi()
:
app.MapOpenApi();
app.MapSwaggerUi();
If you want to add authentication to your Swagger you can use following helper methods:
builder.Services.AddOpenApi("v1", o =>
{
o.AddOAuth2(authorizationUrl, tokenUrl, scopes);
});
app.MapSwaggerUi(o =>
{
o.UseOAuth2(clientId, scopes);
});
There are other helper methods for Duende Identity Server AddIdentityServer()
and Auth0 AddAuth0
.
You can check the samples directory for complete working examples.
Roadmap
✅ Basic UI
✅ Authentication
⏳ Enable all the documents
Pre-release builds
Get the package from here.
Build
Install the required .NET SDK and run:
$ dotnet build
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. |
-
net9.0
- Microsoft.AspNetCore.OpenApi (>= 9.0.0-preview.4.24267.6)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.