Tenon.Infra.Swagger
0.0.1-alpha-202502101434
This is a prerelease version of Tenon.Infra.Swagger.
There is a newer prerelease version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Tenon.Infra.Swagger --version 0.0.1-alpha-202502101434
NuGet\Install-Package Tenon.Infra.Swagger -Version 0.0.1-alpha-202502101434
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="Tenon.Infra.Swagger" Version="0.0.1-alpha-202502101434" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Tenon.Infra.Swagger --version 0.0.1-alpha-202502101434
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Tenon.Infra.Swagger, 0.0.1-alpha-202502101434"
#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 Tenon.Infra.Swagger as a Cake Addin #addin nuget:?package=Tenon.Infra.Swagger&version=0.0.1-alpha-202502101434&prerelease // Install Tenon.Infra.Swagger as a Cake Tool #tool nuget:?package=Tenon.Infra.Swagger&version=0.0.1-alpha-202502101434&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Tenon.Infra.Swagger
介绍
Tenon.Infra.Swagger 是一个用于 ASP.NET Core 应用程序的扩展库,旨在简化 Swagger 的集成和配置,特别是与 JWT 认证的结合。该库提供了便捷的方法来添加 Swagger Bearer 授权头,使得 API 文档能够清晰地展示如何使用 JWT 进行身份验证。
示例代码
以下是如何在 ASP.NET Core 项目中使用 Tenon.Infra.Swagger 的示例代码:
using Microsoft.Extensions.DependencyInjection;
using Tenon.Infra.Swagger.Extensions;
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
// 添加 Swagger Bearer 授权头
services.AddSwaggerBearerAuthorizationHeader();
// 其他服务配置...
}
// 其他方法...
}
通过调用 AddSwaggerBearerAuthorizationHeader
方法,您可以轻松地将 JWT 认证集成到 Swagger 文档中,确保 API 用户能够理解如何进行身份验证。
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.0
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 9.0.0)
- Microsoft.Extensions.Configuration (>= 9.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 9.0.0)
- Microsoft.Extensions.DependencyInjection (>= 9.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Identity.Core (>= 9.0.0)
- Microsoft.Extensions.Options (>= 9.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.0)
- Swashbuckle.AspNetCore.SwaggerGen (>= 7.1.0)
- Swashbuckle.AspNetCore.SwaggerUI (>= 7.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.