![]() |
VOOZH | about |
dotnet add package Galosys.Foundation.Swashbuckle --version 26.5.20.1
NuGet\Install-Package Galosys.Foundation.Swashbuckle -Version 26.5.20.1
<PackageReference Include="Galosys.Foundation.Swashbuckle" Version="26.5.20.1" />
<PackageVersion Include="Galosys.Foundation.Swashbuckle" Version="26.5.20.1" />Directory.Packages.props
<PackageReference Include="Galosys.Foundation.Swashbuckle" />Project file
paket add Galosys.Foundation.Swashbuckle --version 26.5.20.1
#r "nuget: Galosys.Foundation.Swashbuckle, 26.5.20.1"
#:package Galosys.Foundation.Swashbuckle@26.5.20.1
#addin nuget:?package=Galosys.Foundation.Swashbuckle&version=26.5.20.1Install as a Cake Addin
#tool nuget:?package=Galosys.Foundation.Swashbuckle&version=26.5.20.1Install as a Cake Tool
成熟度: 🟢 稳定 — 生产可用,测试充分,活跃维护
基于 Swashbuckle 的 Swagger/OpenAPI 集成模块,为 ASP.NET Core API 提供自动化的在线文档生成、认证支持和自定义头部扩展。
DescriptionAttribute 注释[NonSwaggerGen] 特性隐藏指定接口dotnet add package Galosys.Foundation.Swashbuckle
在 appsettings.json 中添加配置:
{
"Application": {
"Name": "MyAPI"
},
"Swagger": {
"DisplaySchema": false,
"AuthEnabled": true,
"Users": {
"admin": "admin123"
}
}
}
// Program.cs
builder.Services.AddSwaggerGen(builder.Configuration);
// 或手动指定名称
builder.Services.AddSwaggerGen("MyAPI");
app.UseSwaggerGen();
// 自定义 UI 配置
app.UseSwaggerGen(opt =>
{
opt.DefaultModelsExpandDepth(-1);
});
[NonSwaggerGen]
[ApiController]
public class InternalController : ControllerBase
{
// 此控制器将不出现在文档中
}
自动集成 gRPC Swagger,无需额外配置。
| 类/扩展方法 | 说明 |
|---|---|
AddSwaggerGen() |
注册 Swagger 服务 |
UseSwaggerGen() |
启用 Swagger 中间件 |
SwaggerOptions |
配置选项(鉴权、Schema显示) |
NonSwaggerGenAttribute |
标记隐藏的控制器/方法 |
SwaggerAuthMiddleware |
Basic 认证中间件 |
AuthOperationFilter |
自动添加认证安全要求 |
TenantIdHeaderOperationFilter |
注入 x-tenant-id 头部 |
AppIdHeaderOperationFilter |
注入 x-app-id 头部 |
LocalizationHeaderOperationFilter |
注入 Accept-Language 头部 |
ClientTypeHeaderOperationFilter |
注入 x-client-type 头部 |
SignatureHeaderOperationFilter |
注入签名验证头部 |
EnumSchemaFilter |
枚举显示 Description 注释 |
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 2 NuGet packages that depend on Galosys.Foundation.Swashbuckle:
| Package | Downloads |
|---|---|
|
Galosys.Foundation.AspNetCore.MultiTenancy
Galosys.Foundation快速开发库 |
|
|
Galosys.AspNetCore.App
Galosys.Foundation快速开发库 |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 26.5.20.1 | 120 | 5/20/2026 |
| 26.5.19.1 | 111 | 5/19/2026 |
| 26.5.18.1 | 117 | 5/18/2026 |
| 26.5.15.1 | 111 | 5/15/2026 |
| 26.5.12.3 | 115 | 5/12/2026 |
| 26.5.12.2 | 108 | 5/12/2026 |
| 26.4.27.1-rc1 | 114 | 4/26/2026 |
| 26.4.25.1-rc1 | 120 | 4/25/2026 |
| 26.4.22.2-rc7 | 111 | 4/22/2026 |
| 26.4.22.2-rc6 | 113 | 4/22/2026 |
| 26.4.22.2-rc4 | 109 | 4/22/2026 |
| 26.4.22.2-rc3 | 109 | 4/22/2026 |
| 26.4.12.8-rc1 | 115 | 4/12/2026 |
| 26.4.12.7-rc1 | 112 | 4/12/2026 |
| 26.1.30.1-rc1 | 162 | 1/30/2026 |
| 26.1.29.1 | 178 | 1/29/2026 |
| 26.1.28.5 | 172 | 1/28/2026 |
| 26.1.28.4 | 164 | 1/28/2026 |
| 26.1.28.2 | 173 | 1/28/2026 |
| 26.1.23.6 | 166 | 1/23/2026 |