Asp.net core 在swagger中添加代理授权标头
我需要使用.NETCore在swagger ui上添加特定的标题。有没有办法包括这样的标题 已尝试:Asp.net core 在swagger中添加代理授权标头,asp.net-core,swagger-ui,swashbuckle,Asp.net Core,Swagger Ui,Swashbuckle,我需要使用.NETCore在swagger ui上添加特定的标题。有没有办法包括这样的标题 已尝试: 实现IOperationFilter: public void Apply(操作,操作过滤器上下文) { if(operation.Parameters==null) operation.Parameters=newlist(); if(operation.Parameters.All(p=>p.Name!=“代理授权”)) { operation.Parameters.Add(新的非主体参
- 实现IOperationFilter:
public void Apply(操作,操作过滤器上下文) { if(operation.Parameters==null) operation.Parameters=newlist(); if(operation.Parameters.All(p=>p.Name!=“代理授权”)) { operation.Parameters.Add(新的非主体参数 { Name=“代理授权”, In=“header”, Description=“代理授权令牌”, 必需=真, Type=“string” }); } }
- 添加安全定义:
options.AddSecurityDefinition(“代理授权”,新的ApiKeyScheme() { In=“header”, Description=“请在字段中插入代理授权密码”, Name=“代理授权”, Type=“apiKey” });
- 接受字符集
- 接受编码
- 访问控制请求头
- 访问控制请求方法
- 联系
- 内容长度
- 饼干
- 库克2
- 日期
- DNT
- 期待
- 主人
- 活命
- 起源
- 代理-
- 秒-
- 推荐人
- TE
- 拖车
- 传输编码
- 升级
- 通过
proxy-
前缀的标题。你在GitHub上有最小的项目吗?我想解决你的问题…嗨,谢谢你对这个问题感兴趣。请在上找到我的存储库。它显示了正在发生的事情。我只创建了一个实现IOperationFilter的解决方案。但两者的作用相同。Best regardsI在招摇过市的ui团队中输入了一个bug:我看到了对github问题的回应。谢谢