xiaoymin / knife4j

Knife4j is a set of Swagger2 and OpenAPI3 All-in-one enhancement solution

Home Page:https://doc.xiaominfo.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

4.4.0版本不支持多个请求头吗,调试里不显示只显示一个

wangjiancheng180 opened this issue · comments

看了swagger-config返回的security对象多个但是只有一个显示

 "security": [
                    {
                        "Authorization": [

                        ]
                    },
                    {
                        "platformKey": [

                        ]
                    }
                ]
D5B9A2D8-AAC7-4b01-B98B-09854609EAAE

@bean
public GlobalOpenApiCustomizer orderGlobalOpenApiCustomizer() {
return openApi -> {
// 全局添加鉴权参数
if (openApi.getPaths() != null) {
openApi.getPaths().forEach((s, pathItem) -> {
// 为所有接口添加鉴权
pathItem.readOperations().forEach(operation -> {
operation.addSecurityItem(new SecurityRequirement().addList(HttpHeaders.AUTHORIZATION));
operation.addSecurityItem(new SecurityRequirement().addList(BusinessCommonUtil.HEADER_PLATFORM_KEY));
});
});
}

    };

}``