EasilyNET.WebCore.Swagger
3.24.701.90
dotnet add package EasilyNET.WebCore.Swagger --version 3.24.701.90
NuGet\Install-Package EasilyNET.WebCore.Swagger -Version 3.24.701.90
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="EasilyNET.WebCore.Swagger" Version="3.24.701.90" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EasilyNET.WebCore.Swagger --version 3.24.701.90
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EasilyNET.WebCore.Swagger, 3.24.701.90"
#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.
// Install EasilyNET.WebCore.Swagger as a Cake Addin
#addin nuget:?package=EasilyNET.WebCore.Swagger&version=3.24.701.90
// Install EasilyNET.WebCore.Swagger as a Cake Tool
#tool nuget:?package=EasilyNET.WebCore.Swagger&version=3.24.701.90
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
EasilyNET.WebCore.Swagger
将 Swagger 的扩展独立出来,避免 WebCore 的过度依赖.
- 新增 Swagger 页面参数忽略.比如某些默认参数不需要调用者传入,并且也不希望他看见
- 接口隐藏,或者控制器隐藏
添加默认值显示 代码示例
- 在 Swagger 文档中给需要 Authorize 的接口添加 🔒
最新变化
- SwaggerIgnoreAttribute由于官方已经提供了同名特性,所以这里删除相关代码.
可用特性
- ApiGroupAttribute 对控制器进行分组.便于将特有的功能分到一个组方便管理.
- HiddenApiAttribute 隐藏控制器或者单个接口.
- SwaggerIgnoreAttribute 忽略接口参数或者传入实体的属性 代码示例
如何使用?
// 添加 Swagger 服务
private const string name = $"{title}-{version}";
private const string version = "v1";
private const string title = "WebApi.Test";
builder.Services.AddSwaggerGen(c =>
{
// 配置默认的文档信息
c.SwaggerDoc(name, new()
{
Title = title,
Version = version,
Description = "Console.WriteLine(\"🐂🍺\")"
});
// 这里使用EasilyNET提供的扩展配置.
c.EasilySwaggerGenOptions(name);
// 配置认证方式
c.AddSecurityDefinition("Bearer", new()
{
Description = "JWT Authorization header using the Bearer scheme. Example: \"Authorization: Bearer {token}\"",
Name = "Authorization",
In = ParameterLocation.Header,
Type = SecuritySchemeType.ApiKey,
Scheme = "Bearer"
});
});
...
// 注册 Swagger 中间件
app.UseSwagger().UseSwaggerUI(c =>
{
// 配置默认文档
c.SwaggerEndpoint($"/swagger/{name}/swagger.json", $"{title} {version}");
// 使用EasilyNET提供的扩展配置
c.EasilySwaggerUIOptions();
});
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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- EasilyNET.WebCore (>= 3.24.701.90)
- Swashbuckle.AspNetCore.SwaggerGen (>= 6.6.2)
- Swashbuckle.AspNetCore.SwaggerUI (>= 6.6.2)
-
net9.0
- EasilyNET.WebCore (>= 3.24.701.90)
- Swashbuckle.AspNetCore.SwaggerGen (>= 6.6.2)
- Swashbuckle.AspNetCore.SwaggerUI (>= 6.6.2)
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 |
---|---|---|
3.24.701.90 | 65 | 7/1/2024 |
3.24.628.114 | 74 | 6/28/2024 |
3.24.627.145 | 64 | 6/27/2024 |
3.24.620.160 | 77 | 6/20/2024 |
3.24.613.115 | 66 | 6/13/2024 |
3.24.612.95 | 63 | 6/12/2024 |
3.24.528.90 | 76 | 5/28/2024 |
3.24.522.84 | 77 | 5/22/2024 |
3.24.512.213 | 62 | 5/12/2024 |
3.24.508.112 | 77 | 5/8/2024 |
2.2024.428.71 | 77 | 4/28/2024 |
2.2024.427.1128 | 81 | 4/27/2024 |
2.2.72 | 94 | 4/14/2024 |
2.2.71 | 82 | 4/12/2024 |
2.2.8 | 69 | 4/26/2024 |
2.2.6 | 75 | 4/10/2024 |
2.2.5 | 93 | 3/26/2024 |
2.2.4 | 86 | 3/25/2024 |
2.2.3 | 99 | 3/24/2024 |
2.2.2 | 110 | 3/21/2024 |
2.2.1 | 101 | 3/20/2024 |
2.2.0 | 96 | 3/13/2024 |
2.1.9 | 116 | 2/21/2024 |
2.1.8 | 82 | 2/18/2024 |
2.1.7 | 87 | 2/16/2024 |
2.1.6 | 94 | 2/14/2024 |
2.1.5 | 80 | 2/14/2024 |
2.1.4 | 109 | 2/9/2024 |
2.1.3 | 109 | 2/8/2024 |
2.1.2 | 99 | 2/5/2024 |
2.1.1.2 | 168 | 12/26/2023 |
2.1.1.1 | 114 | 12/26/2023 |
2.1.1 | 126 | 12/25/2023 |
2.1.0 | 125 | 12/17/2023 |
2.0.11 | 165 | 12/6/2023 |
2.0.1 | 182 | 11/15/2023 |
2.0.0 | 126 | 11/14/2023 |
1.9.1 | 128 | 11/1/2023 |
1.9.0 | 130 | 10/19/2023 |
1.9.0-preview2 | 226 | 10/12/2023 |
1.9.0-preview1 | 97 | 10/12/2023 |
1.8.9 | 155 | 10/11/2023 |
1.8.8 | 140 | 10/11/2023 |
1.8.7-rc2 | 120 | 9/21/2023 |
1.8.7-rc1 | 103 | 9/12/2023 |
1.8.6 | 170 | 8/31/2023 |
1.8.5 | 509 | 8/25/2023 |
1.8.4 | 153 | 8/24/2023 |
1.8.3 | 146 | 8/23/2023 |
1.8.2 | 203 | 8/22/2023 |
1.8.1 | 178 | 8/18/2023 |
1.8.0 | 155 | 8/15/2023 |
1.7.9 | 181 | 8/11/2023 |
1.7.8 | 138 | 8/11/2023 |
1.7.7 | 167 | 8/10/2023 |
1.7.6 | 161 | 8/9/2023 |
1.7.5 | 206 | 8/9/2023 |
1.7.4 | 245 | 8/3/2023 |
1.7.3 | 175 | 8/1/2023 |
1.7.2 | 164 | 7/31/2023 |
1.7.1 | 142 | 7/27/2023 |
1.7.0 | 161 | 7/25/2023 |
1.6.9 | 175 | 7/25/2023 |
1.6.8 | 156 | 7/24/2023 |
1.6.7 | 186 | 7/20/2023 |
1.6.6 | 167 | 7/19/2023 |
1.6.5 | 142 | 7/19/2023 |
1.6.4 | 162 | 7/17/2023 |
1.6.3 | 151 | 7/17/2023 |
1.6.2 | 218 | 7/12/2023 |
1.6.1 | 229 | 6/30/2023 |
1.6.0 | 147 | 6/26/2023 |
1.5.9 | 184 | 6/22/2023 |
1.5.8 | 204 | 6/15/2023 |
1.5.7.1 | 186 | 6/14/2023 |
1.5.7 | 198 | 6/14/2023 |
1.5.6.2 | 204 | 6/7/2023 |
1.5.6.1 | 175 | 6/7/2023 |
1.5.6 | 174 | 6/7/2023 |
1.5.5.2 | 226 | 5/26/2023 |
1.5.5.1 | 184 | 5/26/2023 |
1.5.5 | 183 | 5/26/2023 |
1.5.4.4 | 169 | 5/25/2023 |
1.5.4.3 | 183 | 5/23/2023 |
1.5.4.2 | 261 | 5/17/2023 |
1.5.4.1 | 156 | 5/16/2023 |
1.5.4 | 244 | 5/11/2023 |
1.5.3 | 174 | 5/11/2023 |
1.5.2 | 195 | 5/10/2023 |
1.5.1 | 163 | 5/10/2023 |
1.5.0 | 211 | 5/6/2023 |
1.4.0 | 178 | 5/5/2023 |
1.3.9 | 221 | 4/23/2023 |