NetPro.Swagger
6.0.8-beta.2
.NET 6.0
This package targets .NET 6.0. The package is compatible with this framework or higher.
.NET Core 3.1
This package targets .NET Core 3.1. The package is compatible with this framework or higher.
This is a prerelease version of NetPro.Swagger.
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 NetPro.Swagger --version 6.0.8-beta.2
NuGet\Install-Package NetPro.Swagger -Version 6.0.8-beta.2
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="NetPro.Swagger" Version="6.0.8-beta.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NetPro.Swagger --version 6.0.8-beta.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: NetPro.Swagger, 6.0.8-beta.2"
#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 NetPro.Swagger as a Cake Addin
#addin nuget:?package=NetPro.Swagger&version=6.0.8-beta.2&prerelease
// Install NetPro.Swagger as a Cake Tool
#tool nuget:?package=NetPro.Swagger&version=6.0.8-beta.2&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Swagger使用
对swagger的封装,包含认证,默认头,默认公共query参数,文件上传
使用
appsetting.json
"SwaggerOption": {
"Enabled": true, //默认启用
"RoutePrefix": "swagger",
"MaxDisplayedTags":"100"//最多显示几个Controller,不写默认100
"ServerPrefix": "lu/", //json endpoint,用于反向代理场景使用
"OAuth2":{
"Server":"www.baidu.com",//开启Oauth2功能
"Scopes": [
{
"Key": "d",
"Value": "b"
}
]
}
"Description": "this is swagger for netcore",
"Title": "Demo swagger",
"Version": "first version",
"TermsOfService": "netcore.com",
"Contact": {
"Email": "swagger@netcore.com",
"Name": "swagger",
"Url": "swagger@netcore.com"
},
"License": {
"Name": "",
"Url": ""
},
"Headers": [ //swagger默认头参数
{
"Name": "User",
"Description": "用户"
}
],
"Query": [ //swagger默认url公共参数
{
"Name": "sign",
"Description": "签名"
},
{
"Name": "timestamp",
"Description": "客户端时间戳"
}
]
}
启用服务
public void ConfigureServices(IServiceCollection services,IConfiguration configuration)
{
services.AddNetProSwagger(configuration);
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseNetProSwagger();
}
注意
webapi项目中不能包含Web相关组件,例如 Microsoft.VisualStudio.Web.CodeGeneration.Design 否则会导致swagger异常
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. 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 was computed. 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 was computed. 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. |
.NET Core | netcoreapp3.1 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETCoreApp 3.1
- Microsoft.Extensions.PlatformAbstractions (>= 1.1.0)
- NetPro.Startup (>= 6.0.8-beta.2)
- Swashbuckle.AspNetCore (>= 5.5.1)
- Swashbuckle.AspNetCore.Filters (>= 5.1.2)
- Swashbuckle.AspNetCore.Newtonsoft (>= 5.5.1)
- Swashbuckle.AspNetCore.ReDoc (>= 5.5.1)
- Swashbuckle.AspNetCore.Swagger (>= 5.5.1)
-
net6.0
- Microsoft.Extensions.PlatformAbstractions (>= 1.1.0)
- NetPro.Startup (>= 6.0.8-beta.2)
- Swashbuckle.AspNetCore (>= 6.2.3)
- Swashbuckle.AspNetCore.Filters (>= 7.0.2)
- Swashbuckle.AspNetCore.Newtonsoft (>= 6.2.3)
- Swashbuckle.AspNetCore.ReDoc (>= 6.2.3)
- Swashbuckle.AspNetCore.Swagger (>= 6.2.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on NetPro.Swagger:
Repository | Stars |
---|---|
LeonKou/NetPro
🌈An enhanced version with clean architecture of asp.netcore,efficiently manage startup,Support for netcore3.1/6.0
|
Version | Downloads | Last updated |
---|---|---|
6.0.16 | 267 | 7/24/2023 |
6.0.15 | 786 | 7/19/2022 |
6.0.14 | 540 | 7/10/2022 |
6.0.13 | 569 | 6/15/2022 |
6.0.12 | 480 | 6/15/2022 |
6.0.11 | 478 | 6/15/2022 |
6.0.10 | 514 | 6/11/2022 |
6.0.9 | 509 | 6/8/2022 |
6.0.8 | 573 | 5/26/2022 |
6.0.8-beta.3 | 141 | 5/24/2022 |
6.0.8-beta.2 | 106 | 5/24/2022 |
6.0.7 | 535 | 5/18/2022 |
6.0.6 | 557 | 4/28/2022 |
6.0.5 | 564 | 3/30/2022 |
6.0.5-beta.20 | 109 | 4/27/2022 |
6.0.5-beta.19 | 112 | 4/25/2022 |
6.0.5-beta.18 | 114 | 4/22/2022 |
6.0.5-beta.17 | 138 | 4/16/2022 |
6.0.5-beta.16 | 191 | 4/8/2022 |
6.0.5-beta.15 | 115 | 4/8/2022 |
6.0.5-beta.14 | 131 | 4/7/2022 |
6.0.5-beta.13 | 122 | 4/7/2022 |
6.0.5-beta.12 | 121 | 4/6/2022 |
6.0.5-beta.11 | 149 | 4/6/2022 |
6.0.5-beta.10 | 137 | 3/31/2022 |
6.0.5-beta.9 | 136 | 3/26/2022 |
6.0.5-beta.8 | 143 | 3/22/2022 |
6.0.5-beta.7 | 121 | 3/21/2022 |
6.0.5-beta.6 | 134 | 3/14/2022 |
6.0.5-beta.5 | 139 | 3/2/2022 |
6.0.5-beta.4 | 134 | 2/22/2022 |
6.0.5-beta.3 | 128 | 2/18/2022 |
6.0.5-beta.2 | 116 | 2/18/2022 |
6.0.5-beta.1 | 130 | 2/16/2022 |
6.0.4 | 690 | 2/10/2022 |
6.0.3 | 465 | 2/9/2022 |
6.0.3-beta.9 | 110 | 2/10/2022 |
6.0.3-beta.7 | 126 | 1/27/2022 |
6.0.3-beta.6 | 126 | 1/19/2022 |
6.0.3-beta.5 | 128 | 1/17/2022 |
6.0.3-beta.4 | 134 | 1/16/2022 |
6.0.3-beta.3 | 135 | 1/14/2022 |
6.0.3-beta.2 | 130 | 1/13/2022 |
6.0.3-beta.1 | 167 | 1/11/2022 |
6.0.2 | 338 | 1/6/2022 |
6.0.1 | 999 | 12/3/2021 |
3.1.11 | 497 | 11/17/2021 |
3.1.10 | 1,142 | 7/29/2021 |
3.1.9 | 1,101 | 7/1/2021 |
3.1.8 | 1,047 | 12/15/2020 |
3.1.6 | 2,194 | 9/16/2020 |
3.1.5 | 1,132 | 9/8/2020 |