We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在demo中,对于传入的header注解:@Header(key="token|接口访问凭证", rule="required")。当进行header规则验证的时候,会将该key的首字符大写。 ValidationApi.php:128 $real_headers[implode('-', array_map('ucfirst', explode('-', $key)))] = $val; 因此注解中@Header(key="token|接口访问凭证", rule="required") 如果首字母是小写的,会报错: [ERROR] 接口访问凭证 字段是必须的[69] in /var/workspace/hyperf-skeleton/vendor/daodao97/apidog/src/Middleware/ApiValidationMiddleware.php. 原因是token首字母是小写,所以找不到。 综上: 在注解header中,key的首字母必须大写。demo中是小写的。
The text was updated successfully, but these errors were encountered:
标准的header参数格式为 Aaa-Bbb, 但是hyperf request 底层转换时,会把所有的header参数全部小写化,aaa-bbb 这种
所以验证时又不得不再次转换,才能找到对应的key, 但是要求就是 必须是一个规范的 header 参数名
Sorry, something went wrong.
No branches or pull requests
在demo中,对于传入的header注解:@Header(key="token|接口访问凭证", rule="required")。当进行header规则验证的时候,会将该key的首字符大写。
ValidationApi.php:128
$real_headers[implode('-', array_map('ucfirst', explode('-', $key)))] = $val;
因此注解中@Header(key="token|接口访问凭证", rule="required") 如果首字母是小写的,会报错:
[ERROR] 接口访问凭证 字段是必须的[69] in /var/workspace/hyperf-skeleton/vendor/daodao97/apidog/src/Middleware/ApiValidationMiddleware.php.
原因是token首字母是小写,所以找不到。
综上:
在注解header中,key的首字母必须大写。demo中是小写的。
The text was updated successfully, but these errors were encountered: