清理swagger配置
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
827615f272
commit
08f4a0877b
|
@ -74,6 +74,15 @@ public static class SwaggerSetup
|
||||||
return versions.Any(v => v.ToString() == docName);
|
return versions.Any(v => v.ToString() == docName);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
//添加注释
|
||||||
|
var basePath = AppContext.BaseDirectory;
|
||||||
|
var xmlPath1 = Path.Combine(basePath, "IRaCIS.Core.Application.xml");
|
||||||
|
var xmlPath2 = Path.Combine(basePath, "IRaCIS.Core.API.xml");
|
||||||
|
options.IncludeXmlComments(xmlPath1, true);
|
||||||
|
options.IncludeXmlComments(xmlPath2, true);
|
||||||
|
|
||||||
|
// 在header中添加token,传递到后台
|
||||||
options.OperationFilter<SecurityRequirementsOperationFilter>();
|
options.OperationFilter<SecurityRequirementsOperationFilter>();
|
||||||
|
|
||||||
|
|
||||||
|
@ -87,17 +96,6 @@ public static class SwaggerSetup
|
||||||
//Type = "apiKey"
|
//Type = "apiKey"
|
||||||
});
|
});
|
||||||
|
|
||||||
//添加注释
|
|
||||||
var basePath = AppContext.BaseDirectory;
|
|
||||||
var xmlPath1 = Path.Combine(basePath, "IRaCIS.Core.Application.xml");
|
|
||||||
var xmlPath2 = Path.Combine(basePath, "IRaCIS.Core.API.xml");
|
|
||||||
options.IncludeXmlComments(xmlPath1, true);
|
|
||||||
options.IncludeXmlComments(xmlPath2, true);
|
|
||||||
|
|
||||||
// 在header中添加token,传递到后台
|
|
||||||
options.OperationFilter<SecurityRequirementsOperationFilter>();
|
|
||||||
|
|
||||||
|
|
||||||
//// 添加登录按钮
|
//// 添加登录按钮
|
||||||
//options.AddSecurityDefinition("bearerAuth", new OpenApiSecurityScheme()
|
//options.AddSecurityDefinition("bearerAuth", new OpenApiSecurityScheme()
|
||||||
//{
|
//{
|
||||||
|
@ -140,19 +138,7 @@ public static class SwaggerSetup
|
||||||
return versions.Any(v => v.ToString() == docName);
|
return versions.Any(v => v.ToString() == docName);
|
||||||
});
|
});
|
||||||
|
|
||||||
options.OperationFilter<SecurityRequirementsOperationFilter>();
|
|
||||||
|
|
||||||
|
|
||||||
// 添加登录按钮
|
|
||||||
options.AddSecurityDefinition("bearerAuth", new OpenApiSecurityScheme()
|
|
||||||
{
|
|
||||||
Description = "JWT Authorization header using the Bearer scheme. Example: \"Authorization: Bearer {token}\"",
|
|
||||||
Name = "Authorization",
|
|
||||||
|
|
||||||
//In = "header",
|
|
||||||
//Type = "apiKey"
|
|
||||||
});
|
|
||||||
|
|
||||||
//添加注释
|
//添加注释
|
||||||
var basePath = AppContext.BaseDirectory;
|
var basePath = AppContext.BaseDirectory;
|
||||||
var xmlPath1 = Path.Combine(basePath, "IRaCIS.Core.Application.xml");
|
var xmlPath1 = Path.Combine(basePath, "IRaCIS.Core.Application.xml");
|
||||||
|
@ -164,15 +150,15 @@ public static class SwaggerSetup
|
||||||
options.OperationFilter<SecurityRequirementsOperationFilter>();
|
options.OperationFilter<SecurityRequirementsOperationFilter>();
|
||||||
|
|
||||||
|
|
||||||
//// 添加登录按钮
|
// 添加登录按钮
|
||||||
//options.AddSecurityDefinition("bearerAuth", new OpenApiSecurityScheme()
|
options.AddSecurityDefinition("bearerAuth", new OpenApiSecurityScheme()
|
||||||
//{
|
{
|
||||||
// Description = "JWT Authorization header using the Bearer scheme. Example: \"Authorization: Bearer {token}\"",
|
Description = "JWT Authorization header using the Bearer scheme. Example: \"Authorization: Bearer {token}\"",
|
||||||
// Name = "Authorization",
|
Name = "Authorization",
|
||||||
|
//In = "header",
|
||||||
|
//Type = "apiKey"
|
||||||
|
});
|
||||||
|
|
||||||
// //In = "header",
|
|
||||||
// //Type = "apiKey"
|
|
||||||
//});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue