Closed brucebnu closed 7 years ago
新版本的swagger ui 不在使用get验证登录,改用header。apache下正常。 nginx下自定义header, 在nginx.conf 开启 underscores_in_headers on; #默认off api_key会解析为api-key,php无法获取进行验证,报错如下,建议统一api-key
{"securityDefinitions":{"api_key":{"in":"header","type":"apiKey","name":"api_key"}},"swagger":"2.0","schemes":["http"],"info":{"title":"Please take authentication firstly."}}
参考:http://stackoverflow.com/questions/22856136/why-underscores-are-forbidden-in-http-header-names
你可以先通过配置SwaggerApiAction::apiKeyParam改成 api-key来试试。
SwaggerApiAction::apiKeyParam
api-key
是的,现在是这么处理的,谢谢!
新版本的swagger ui 不在使用get验证登录,改用header。apache下正常。 nginx下自定义header, 在nginx.conf 开启 underscores_in_headers on; #默认off api_key会解析为api-key,php无法获取进行验证,报错如下,建议统一api-key
{"securityDefinitions":{"api_key":{"in":"header","type":"apiKey","name":"api_key"}},"swagger":"2.0","schemes":["http"],"info":{"title":"Please take authentication firstly."}}
参考:http://stackoverflow.com/questions/22856136/why-underscores-are-forbidden-in-http-header-names