Soenneker.Extensions.ApplicationBuilder.Swagger 4.0.98

Prefix Reserved
dotnet add package Soenneker.Extensions.ApplicationBuilder.Swagger --version 4.0.98
                    
NuGet\Install-Package Soenneker.Extensions.ApplicationBuilder.Swagger -Version 4.0.98
                    
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="Soenneker.Extensions.ApplicationBuilder.Swagger" Version="4.0.98" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Extensions.ApplicationBuilder.Swagger" Version="4.0.98" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Extensions.ApplicationBuilder.Swagger" />
                    
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 Soenneker.Extensions.ApplicationBuilder.Swagger --version 4.0.98
                    
#r "nuget: Soenneker.Extensions.ApplicationBuilder.Swagger, 4.0.98"
                    
#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 Soenneker.Extensions.ApplicationBuilder.Swagger@4.0.98
                    
#: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=Soenneker.Extensions.ApplicationBuilder.Swagger&version=4.0.98
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.ApplicationBuilder.Swagger&version=4.0.98
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

alternate text is missing from this package README image Soenneker.Extensions.ApplicationBuilder.Swagger

Adds Swashbuckle's Swagger JSON middleware and a Swagger UI configured for a single v1 document.

Installation

dotnet add package Soenneker.Extensions.ApplicationBuilder.Swagger

Register Swagger services

using Microsoft.OpenApi;

builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen(options =>
{
    options.SwaggerDoc("v1", new OpenApiInfo
    {
        Title = "Example API",
        Version = "v1"
    });
});

This package configures middleware only. AddSwaggerGen() and a document named v1 must already be registered.

Configure the pipeline

using Soenneker.Extensions.ApplicationBuilder.Swagger;

WebApplication app = builder.Build();

if (app.Environment.IsDevelopment())
    app.ConfigureSwagger();

app.MapControllers();
app.Run();

ConfigureSwagger() provides:

  • the default JSON route at /swagger/{documentName}/swagger.json
  • Swagger UI at /swagger
  • a UI entry for the v1 document
  • request-duration display and deep links in the UI

The UI uses a relative ./v1/swagger.json URL so it follows an application PathBase when hosted below a reverse-proxy subpath.

The helper does not inspect the hosting environment, require authentication, or hide the OpenAPI document. Call it only in intended environments or place suitable access controls in front of both /swagger and /swagger/v1/swagger.json; API descriptions can reveal routes, request models, and security scheme metadata even when the underlying endpoints remain authorized.

The v1 document name and /swagger UI prefix are fixed. Applications that publish multiple documents or need custom UI settings should configure UseSwagger() and UseSwaggerUI() directly.

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
4.0.98 52 8/30/2026
4.0.97 56 8/29/2026
4.0.96 203 7/28/2026
4.0.95 106 7/16/2026
4.0.94 295 6/22/2026
4.0.93 119 6/22/2026
4.0.92 115 6/20/2026
4.0.91 113 6/19/2026
4.0.90 116 6/18/2026
4.0.89 177 6/5/2026
4.0.88 129 6/1/2026
4.0.87 128 6/1/2026
4.0.86 152 5/30/2026
4.0.85 115 5/30/2026
4.0.84 327 4/22/2026
4.0.83 150 3/26/2026
4.0.82 115 3/26/2026
4.0.81 115 3/25/2026
4.0.80 115 3/24/2026
4.0.79 138 3/12/2026
Loading failed

Improve Swagger pipeline configuration