EasilyNET.WebCore.Swagger
3.24.926.182
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package EasilyNET.WebCore.Swagger --version 3.24.926.182
NuGet\Install-Package EasilyNET.WebCore.Swagger -Version 3.24.926.182
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.926.182" />
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.926.182
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EasilyNET.WebCore.Swagger, 3.24.926.182"
#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.926.182 // Install EasilyNET.WebCore.Swagger as a Cake Tool #tool nuget:?package=EasilyNET.WebCore.Swagger&version=3.24.926.182
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.926.182)
- Swashbuckle.AspNetCore.SwaggerGen (>= 6.8.0)
- Swashbuckle.AspNetCore.SwaggerUI (>= 6.8.0)
-
net9.0
- EasilyNET.WebCore (>= 3.24.926.182)
- Swashbuckle.AspNetCore.SwaggerGen (>= 6.8.0)
- Swashbuckle.AspNetCore.SwaggerUI (>= 6.8.0)
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.1018.204 | 42 | 10/18/2024 |
3.24.1018.175 | 39 | 10/18/2024 |
3.24.1018.166 | 39 | 10/18/2024 |
3.24.1018.93 | 43 | 10/18/2024 |
3.24.1017.42 | 35 | 10/16/2024 |
3.24.1016.161 | 33 | 10/16/2024 |
3.24.1015.231 | 39 | 10/15/2024 |
3.24.1015.14 | 62 | 10/14/2024 |
3.24.1012.114 | 68 | 10/12/2024 |
3.24.1009.115 | 70 | 10/9/2024 |
3.24.1008.160 | 61 | 10/8/2024 |
3.24.1008.133 | 66 | 10/8/2024 |
3.24.1007.185 | 58 | 10/7/2024 |
3.24.1003.33 | 67 | 10/2/2024 |
3.24.1002.162 | 65 | 10/2/2024 |
3.24.929.143 | 66 | 9/29/2024 |
3.24.929.141 | 88 | 9/29/2024 |
3.24.929.131 | 70 | 9/29/2024 |
3.24.929.122 | 71 | 9/29/2024 |
3.24.926.184 | 82 | 9/26/2024 |
3.24.926.182 | 70 | 9/26/2024 |
3.24.926.175 | 78 | 9/26/2024 |
3.24.924.160 | 67 | 9/24/2024 |
3.24.924.133 | 91 | 9/24/2024 |
3.24.924.124 | 69 | 9/24/2024 |
3.24.924.10 | 81 | 9/23/2024 |
3.24.924.1 | 68 | 9/23/2024 |
3.24.923.234 | 78 | 9/23/2024 |
3.24.923.232 | 74 | 9/23/2024 |
3.24.923.155 | 75 | 9/23/2024 |
3.24.919.92 | 84 | 9/19/2024 |
3.24.914.125 | 106 | 9/14/2024 |
3.24.914.115 | 95 | 9/14/2024 |
3.24.914.111 | 113 | 9/14/2024 |
3.24.911.95 | 93 | 9/11/2024 |
3.24.908.215 | 87 | 9/8/2024 |
3.24.904.200 | 87 | 9/4/2024 |
3.24.828.163 | 111 | 8/28/2024 |
3.24.820.173 | 113 | 8/20/2024 |
3.24.814.92 | 103 | 8/14/2024 |
3.24.812.115 | 125 | 8/12/2024 |
3.24.802.100 | 95 | 8/2/2024 |
3.24.801.162 | 75 | 8/1/2024 |
3.24.801.160 | 94 | 8/1/2024 |
3.24.730.164 | 62 | 7/30/2024 |
3.24.730.91 | 68 | 7/30/2024 |
3.24.724.91 | 66 | 7/24/2024 |
3.24.718.105 | 113 | 7/18/2024 |
3.24.716.95 | 91 | 7/16/2024 |
3.24.712.94 | 86 | 7/12/2024 |
3.24.710.14 | 96 | 7/9/2024 |
3.24.709.105 | 109 | 7/9/2024 |
3.24.704.94 | 111 | 7/4/2024 |
3.24.701.90 | 98 | 7/1/2024 |
3.24.628.114 | 101 | 6/28/2024 |
3.24.627.145 | 96 | 6/27/2024 |
3.24.620.160 | 104 | 6/20/2024 |
3.24.613.115 | 97 | 6/13/2024 |
3.24.612.95 | 86 | 6/12/2024 |
3.24.528.90 | 99 | 5/28/2024 |
3.24.522.84 | 116 | 5/22/2024 |
3.24.512.213 | 82 | 5/12/2024 |
3.24.508.112 | 104 | 5/8/2024 |
2.2024.428.71 | 98 | 4/28/2024 |
2.2024.427.1128 | 109 | 4/27/2024 |
2.2.72 | 123 | 4/14/2024 |
2.2.71 | 115 | 4/12/2024 |
2.2.8 | 92 | 4/26/2024 |
2.2.6 | 104 | 4/10/2024 |
2.2.5 | 122 | 3/26/2024 |
2.2.4 | 109 | 3/25/2024 |
2.2.3 | 121 | 3/24/2024 |
2.2.2 | 149 | 3/21/2024 |
2.2.1 | 119 | 3/20/2024 |
2.2.0 | 129 | 3/13/2024 |
2.1.9 | 140 | 2/21/2024 |
2.1.8 | 103 | 2/18/2024 |
2.1.7 | 113 | 2/16/2024 |
2.1.6 | 118 | 2/14/2024 |
2.1.5 | 110 | 2/14/2024 |
2.1.4 | 136 | 2/9/2024 |
2.1.3 | 134 | 2/8/2024 |
2.1.2 | 125 | 2/5/2024 |
2.1.1.2 | 197 | 12/26/2023 |
2.1.1.1 | 148 | 12/26/2023 |
2.1.1 | 146 | 12/25/2023 |
2.1.0 | 143 | 12/17/2023 |
2.0.11 | 219 | 12/6/2023 |
2.0.1 | 204 | 11/15/2023 |
2.0.0 | 150 | 11/14/2023 |
1.9.1 | 156 | 11/1/2023 |
1.9.0 | 159 | 10/19/2023 |
1.9.0-preview2 | 274 | 10/12/2023 |
1.9.0-preview1 | 141 | 10/12/2023 |
1.8.9 | 192 | 10/11/2023 |
1.8.8 | 165 | 10/11/2023 |
1.8.7-rc2 | 145 | 9/21/2023 |
1.8.7-rc1 | 149 | 9/12/2023 |
1.8.6 | 203 | 8/31/2023 |
1.8.5 | 757 | 8/25/2023 |
1.8.4 | 179 | 8/24/2023 |
1.8.3 | 201 | 8/23/2023 |
1.8.2 | 232 | 8/22/2023 |
1.8.1 | 204 | 8/18/2023 |
1.8.0 | 174 | 8/15/2023 |
1.7.9 | 202 | 8/11/2023 |
1.7.8 | 162 | 8/11/2023 |
1.7.7 | 192 | 8/10/2023 |
1.7.6 | 183 | 8/9/2023 |
1.7.5 | 230 | 8/9/2023 |
1.7.4 | 287 | 8/3/2023 |
1.7.3 | 203 | 8/1/2023 |
1.7.2 | 189 | 7/31/2023 |
1.7.1 | 161 | 7/27/2023 |
1.7.0 | 192 | 7/25/2023 |
1.6.9 | 216 | 7/25/2023 |
1.6.8 | 187 | 7/24/2023 |
1.6.7 | 210 | 7/20/2023 |
1.6.6 | 189 | 7/19/2023 |
1.6.5 | 167 | 7/19/2023 |
1.6.4 | 181 | 7/17/2023 |
1.6.3 | 172 | 7/17/2023 |
1.6.2 | 244 | 7/12/2023 |
1.6.1 | 251 | 6/30/2023 |
1.6.0 | 173 | 6/26/2023 |
1.5.9 | 210 | 6/22/2023 |
1.5.8 | 233 | 6/15/2023 |
1.5.7.1 | 217 | 6/14/2023 |
1.5.7 | 226 | 6/14/2023 |
1.5.6.2 | 226 | 6/7/2023 |
1.5.6.1 | 198 | 6/7/2023 |
1.5.6 | 198 | 6/7/2023 |
1.5.5.2 | 250 | 5/26/2023 |
1.5.5.1 | 214 | 5/26/2023 |
1.5.5 | 213 | 5/26/2023 |
1.5.4.4 | 191 | 5/25/2023 |
1.5.4.3 | 212 | 5/23/2023 |
1.5.4.2 | 284 | 5/17/2023 |
1.5.4.1 | 182 | 5/16/2023 |
1.5.4 | 275 | 5/11/2023 |
1.5.3 | 192 | 5/11/2023 |
1.5.2 | 214 | 5/10/2023 |
1.5.1 | 184 | 5/10/2023 |
1.5.0 | 232 | 5/6/2023 |
1.4.0 | 205 | 5/5/2023 |
1.3.9 | 256 | 4/23/2023 |