SwaggerUI.AspNetCore
5.28.0
See the version list below for details.
dotnet add package SwaggerUI.AspNetCore --version 5.28.0
NuGet\Install-Package SwaggerUI.AspNetCore -Version 5.28.0
<PackageReference Include="SwaggerUI.AspNetCore" Version="5.28.0" />
<PackageVersion Include="SwaggerUI.AspNetCore" Version="5.28.0" />
<PackageReference Include="SwaggerUI.AspNetCore" />
paket add SwaggerUI.AspNetCore --version 5.28.0
#r "nuget: SwaggerUI.AspNetCore, 5.28.0"
#:package SwaggerUI.AspNetCore@5.28.0
#addin nuget:?package=SwaggerUI.AspNetCore&version=5.28.0
#tool nuget:?package=SwaggerUI.AspNetCore&version=5.28.0
SwaggerUI.AspNetCore
A swagger-ui dist package for aspnetcore. Let the aspnetcore program provide swagger-ui endpoint.
- Provides minimizing and original swagger-ui
- Lightweight and fast (Pre gzip and simple mapping)
- Pre configured for
Microsoft.AspNetCore.OpenApi
How to use
Install package
dotnet add package SwaggerUI.AspNetCoreSetup with code
Add
MapSwaggerUIinto request pipeline.app.MapSwaggerUI();
Now it will work with Microsoft.AspNetCore.OpenApi (aspnetcore api template version of .net9 or higher). Now access /swagger, you will see swagger-ui.
Configure
simple configuration
app.MapSwaggerUI(routePrefix: "/swagger",
openApiEndpoint: "/openapi/v1.json");
routePrefixset the swagger-ui access pathopenApiEndpointset the openapi doc access pathaspnetcore apitemplate in.net9default is/openapi/v1.json- Support
relative pathorabsolute path- If use
swagger. Normally, the path is/swagger/v1/swagger.json - If set to a non-same-origin
absolute path,CORSis required
- If use
full configuration
app.MapSwaggerUI(options =>
{
options.RoutePrefix = "/swagger";
//support named and multi openapi endpoint
options.OpenApiEndpoints.Add("/openapi/v1.json");
//Javascript code run before swagger-ui initialization
options.CustomCodeBeforeInitialization =
"""
alert("Hello");
""";
//Javascript object to set and override all configuration before
options.CustomConfigurationObject =
"""
{
url: null,
urls: [ { url: "/openapi/v1.json", name: "default"}]
}
""";
});
Support full swagger-ui configuration by set Javascript object code for CustomConfigurationObject
More configuration references: swagger-ui configuration doc
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on SwaggerUI.AspNetCore:
| Repository | Stars |
|---|---|
|
stratosblue/IntelliSenseLocalizer
a tool for generate .net Localized IntelliSense files. 用于生成本地化 .net IntelliSense文件的工具。
|
| Version | Downloads | Last Updated |
|---|---|---|
| 5.32.5 | 75 | 4/28/2026 |
| 5.32.4 | 129 | 4/19/2026 |
| 5.32.3 | 182 | 4/15/2026 |
| 5.32.2 | 109 | 4/8/2026 |
| 5.32.1 | 162 | 3/18/2026 |
| 5.32.0 | 281 | 2/28/2026 |
| 5.31.2 | 474 | 2/21/2026 |
| 5.31.0 | 1,274 | 12/13/2025 |
| 5.30.3 | 255 | 11/26/2025 |
| 5.30.2 | 1,047 | 11/11/2025 |
| 5.30.1 | 3,196 | 11/1/2025 |
| 5.30.0 | 1,200 | 10/28/2025 |
| 5.29.5 | 2,808 | 10/19/2025 |
| 5.29.4 | 2,047 | 10/11/2025 |
| 5.29.0 | 8,769 | 9/10/2025 |
| 5.28.1 | 835 | 9/6/2025 |
| 5.28.0 | 1,953 | 8/30/2025 |
| 5.27.1 | 5,817 | 8/10/2025 |
| 5.27.0 | 4,806 | 7/21/2025 |
| 5.26.2 | 1,426 | 7/8/2025 |