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
Describe the bug RPC服务开启验证器使用时报错
Details
bean配置文件中配置RPC服务开启验证器
'serviceDispatcher' => [ 'afterMiddlewares' => [ \Swoft\Rpc\Server\Middleware\ValidatorMiddleware::class ] ],
当使用验证器注解时,ValidatorMiddleware::class 第41行的 $request->getParamsMap()的实现中
namespace Swoft\Rpc\Server; public function getParamsMap(): array { $rc = BeanFactory::getReflection($this->interface); $rxParams = $rc['methods'][$this->method]['params']; $index = 0;//此处index值锁定,导致$paramsMap无法正确获取$this->params $paramsMap = []; foreach ($rxParams as $methodParams) { if (!isset($this->params[$index])) { break; } [$name] = $methodParams; $paramsMap[$name] = $this->params[$index]; } return $paramsMap; }
此处是否可以修改为
public function getParamsMap(): array { $rc = BeanFactory::getReflection($this->interface); $rxParams = $rc['methods'][$this->method]['params']; //$index = 0; $paramsMap = []; foreach ($rxParams as $index=>$methodParams) { if (!isset($this->params[$index])) { break; } [$name] = $methodParams; $paramsMap[$name] = $this->params[$index]; } return $paramsMap; }
The text was updated successfully, but these errors were encountered:
准确定位是rpc-server Request类的getParamsMap方法
Sorry, something went wrong.
swoft-cloud/swoft-component@f279153
fix: swoft-cloud/swoft/issues/1286 collect params error
87f59b9
stelin
inhere
JasonYHZ
No branches or pull requests
Describe the bug
RPC服务开启验证器使用时报错
Details
当使用验证器注解时,ValidatorMiddleware::class 第41行的 $request->getParamsMap()的实现中
The text was updated successfully, but these errors were encountered: