Asp.net core mvc 承载令牌身份验证不适用于Swashback和ASPNetZero/ABP

Asp.net core mvc 承载令牌身份验证不适用于Swashback和ASPNetZero/ABP,asp.net-core-mvc,swagger,swagger-ui,aspnetboilerplate,swashbuckle.aspnetcore,Asp.net Core Mvc,Swagger,Swagger Ui,Aspnetboilerplate,Swashbuckle.aspnetcore,我正试图在我的Swagger规范和SwaggerUI中包含安全标头信息,因为我希望第三方系统能够轻松使用我的API,并且能够使用CodeGen工具(如Swagger CodeGen和NSwag)从中生成客户端库 我正在使用Swashback/Swagggergen在运行时自动生成文档。 我的API使用承载令牌身份验证,我希望我的SwaggerDocs反映我的身份验证方案。我还能够在我的SwaggerDocs中看到所需的安全头信息,并且能够让客户端在尝试API调用时通过SwaggerUI测试身份验

我正试图在我的Swagger规范和SwaggerUI中包含安全标头信息,因为我希望第三方系统能够轻松使用我的API,并且能够使用CodeGen工具(如Swagger CodeGen和NSwag)从中生成客户端库

我正在使用Swashback/Swagggergen在运行时自动生成文档。 我的API使用承载令牌身份验证,我希望我的SwaggerDocs反映我的身份验证方案。我还能够在我的SwaggerDocs中看到所需的安全头信息,并且能够让客户端在尝试API调用时通过SwaggerUI测试身份验证

但是,我无法成功地将我的安全标头信息显示在我自己的解决方案中

这是调试期间通过本地SwaggerUI查看SwaggerDocs时我当前看到的内容:

请注意,生成的OAS3标记在运行时正确呈现

以下是由Swashback/Swagggergen生成的实际标记:

{
“openapi”:“3.0.1”,
“信息”:{
“标题”:“MyDemo主机API v1”,
“版本”:“v1”
},
“路径”:{
“/api/services/app/Tenant/CreateTenant”:{
“职务”:{
“标签”:[
“租户”
],
“操作ID”:“APIServicesAppRenantCreateTropost”,
“请求主体”:{
“内容”:{
“应用程序/json修补程序+json”:{
“模式”:{
“allOf”:[
{
$ref:“#/components/schemas/CreateTenantInput”
}
]
}
},
“应用程序/json”:{
“模式”:{
“allOf”:[
{
$ref:“#/components/schemas/CreateTenantInput”
}
]
}
},
“text/json”:{
“模式”:{
“allOf”:[
{
$ref:“#/components/schemas/CreateTenantInput”
}
]
}
},
“应用程序/*+json”:{
“模式”:{
“allOf”:[
{
$ref:“#/components/schemas/CreateTenantInput”
}
]
}
}
}
},
“答复”:{
"200": {
“说明”:“成功”,
“内容”:{
“文本/纯文本”:{
“模式”:{
“$ref”:“#/components/schemas/SwaggerDocResponseWrapper”
}
},
“应用程序/json”:{
“模式”:{
“$ref”:“#/components/schemas/SwaggerDocResponseWrapper”
}
},
“text/json”:{
“模式”:{
“$ref”:“#/components/schemas/SwaggerDocResponseWrapper”
}
}
}
}
},
“安全”:[
{
“持票人”:[]
}
]
}
}
},
“组成部分”:{
“模式”:{
“CreateTenantInput”:{
“必需”:[
“adminEmailAddress”,
“姓名”,
“租户名称”
],
“类型”:“对象”,
“财产”:{
“租户名称”:{
“maxLength”:64,
“minLength”:0,
“模式”:“^[a-zA-Z][a-zA-Z0-9_-][1,}$”,
“类型”:“字符串”
},
“姓名”:{
“最大长度”:128,
“minLength”:0,
“类型”:“字符串”
},
“adminEmailAddress”:{
“最大长度”:256,
“minLength”:0,
“类型”:“字符串”,
“格式”:“电子邮件”
},
“管理员密码”:{
“最大长度”:128,
“minLength”:0,
“类型”:“字符串”,
“可为空”:真
},
“连接字符串”:{
“maxLength”:1024,
“类型”:“字符串”,
“可为空”:真
},
“shouldChangePasswordOnNextLogin”:{
“类型”:“布尔”
},
“sendActivationEmail”:{
“类型”:“布尔”
},
“编辑ID”:{
“类型”:“整数”,
“格式”:“int32”,
    [SwaggerDoc(ApiNames.HostApiv1, ApiNames.PartnerApiv1, ApiNames.TenantApiv1)]
    public class SystemStatusAppService: MyDemoAppServiceBase, ISystemStatusAppService
    {
        [ProducesResponseType(200, Type = typeof(SwaggerDocResponseWrapper))]
        public async Task Ping()
        {
            //Do nothing - will return status code 200
        }

        [AbpAuthorize()]
        [ProducesResponseType(200, Type = typeof(SwaggerDocResponseWrapper))]
        public async Task PingWithAuth()
        {
            //Do nothing - will return status code 200
        }
    }