EasilyNET.WebCore.Swagger 1.7.5

There is a newer version of this package available.
See the version list below for details.
dotnet add package EasilyNET.WebCore.Swagger --version 1.7.5
                    
NuGet\Install-Package EasilyNET.WebCore.Swagger -Version 1.7.5
                    
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="1.7.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EasilyNET.WebCore.Swagger" Version="1.7.5" />
                    
Directory.Packages.props
<PackageReference Include="EasilyNET.WebCore.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 EasilyNET.WebCore.Swagger --version 1.7.5
                    
#r "nuget: EasilyNET.WebCore.Swagger, 1.7.5"
                    
#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 EasilyNET.WebCore.Swagger@1.7.5
                    
#: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=EasilyNET.WebCore.Swagger&version=1.7.5
                    
Install as a Cake Addin
#tool nuget:?package=EasilyNET.WebCore.Swagger&version=1.7.5
                    
Install as a Cake Tool

EasilyNET.WebCore.Swagger

将 Swagger 的扩展独立出来,避免 WebCore 的过度依赖.

  • 新增 Swagger 页面参数忽略.比如某些默认参数不需要调用者传入,并且也不希望他看见
  • 接口隐藏,或者控制器隐藏
  • 添加默认值显示 代码示例
  • 在 Swagger 文档中给需要 Authorize 的接口添加 🔒

可用特性

  • 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 Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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 was computed.  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. 
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.25.921.71 175 9/20/2025
4.25.919.15 295 9/18/2025
4.25.918.142 294 9/18/2025
4.25.918.115 280 9/18/2025
4.25.918.30 282 9/17/2025
4.25.917.141 292 9/17/2025
4.25.917.134 293 9/17/2025
4.25.911.151 160 9/11/2025
4.25.905.150 147 9/5/2025
4.25.820.100 156 8/20/2025
4.25.814.175 160 8/14/2025
4.25.731.155 134 7/31/2025
4.25.724.1 557 7/23/2025
4.25.720.80 252 7/20/2025
4.25.716.42 163 7/15/2025
4.25.617.153 191 6/17/2025
4.25.616.190 168 6/16/2025
4.25.616.182 167 6/16/2025
4.25.613.111 312 6/13/2025
4.25.609.190 360 6/9/2025
2.2.5 191 3/26/2024
2.2.4 185 3/25/2024
2.2.3 202 3/24/2024
2.2.2 219 3/21/2024
2.2.1 193 3/20/2024
2.2.0 197 3/13/2024
2.1.9 214 2/21/2024
2.1.8 172 2/18/2024
2.1.7 191 2/16/2024
2.1.6 185 2/14/2024
2.1.5 184 2/14/2024
2.1.4 203 2/9/2024
2.1.3 205 2/8/2024
2.1.2 190 2/5/2024
2.1.1.2 263 12/26/2023
2.1.1.1 214 12/26/2023
2.1.1 211 12/25/2023
2.1.0 189 12/17/2023
2.0.11 268 12/6/2023
2.0.1 257 11/15/2023
2.0.0 210 11/14/2023
1.9.1 206 11/1/2023
1.9.0 205 10/19/2023
1.9.0-preview2 361 10/12/2023
1.9.0-preview1 199 10/12/2023
1.8.9 253 10/11/2023
1.8.8 229 10/11/2023
1.8.7-rc2 212 9/21/2023
1.8.7-rc1 183 9/12/2023
1.8.6 273 8/31/2023
1.8.5 903 8/25/2023
1.8.4 253 8/24/2023
1.8.3 276 8/23/2023
1.8.2 303 8/22/2023
1.8.1 277 8/18/2023
1.8.0 239 8/15/2023
1.7.9 298 8/11/2023
1.7.8 236 8/11/2023
1.7.7 272 8/10/2023
1.7.6 259 8/9/2023
1.7.5 299 8/9/2023
1.7.4 360 8/3/2023
1.7.3 275 8/1/2023
1.7.2 265 7/31/2023
1.7.1 251 7/27/2023
1.7.0 273 7/25/2023
1.6.9 293 7/25/2023
1.6.8 260 7/24/2023
1.6.7 290 7/20/2023
1.6.6 277 7/19/2023
1.6.5 245 7/19/2023
1.6.4 261 7/17/2023
1.6.3 249 7/17/2023
1.6.2 323 7/12/2023
1.6.1 334 6/30/2023
1.6.0 250 6/26/2023
1.5.9 294 6/22/2023
1.5.8 311 6/15/2023
1.5.7.1 295 6/14/2023
1.5.7 316 6/14/2023
1.5.6.2 318 6/7/2023
1.5.6.1 290 6/7/2023
1.5.6 289 6/7/2023
1.5.5.2 331 5/26/2023
1.5.5.1 308 5/26/2023
1.5.5 311 5/26/2023
1.5.4.4 292 5/25/2023
1.5.4.3 312 5/23/2023
1.5.4.2 378 5/17/2023
1.5.4.1 279 5/16/2023
1.5.4 370 5/11/2023
1.5.3 292 5/11/2023
1.5.2 319 5/10/2023
1.5.1 271 5/10/2023
1.5.0 331 5/6/2023
1.4.0 297 5/5/2023
1.3.9 336 4/23/2023