protected function getParameterModel($paramName, $modelClassName, $requestParams)
    {
        $paramModel = new $modelClassName;

        if (!$paramModel instanceof \yii\base\Model) {
            throw new \yii\base\InvalidParamException("Parameter '{$paramName}' must be instance of \yii\base\Model");
        }

        if (in_array($this->scenario, $paramModel->scenarios())) {
            $paramModel->scenario = $this->scenario;
            $paramModel->setAttributes($requestParams[$paramName], true);
        } else {
            $paramModel->setAttributes($requestParams[$paramName], false);
        }

        if (!$paramModel->validate()) {
            throw new ValidationException('Invalid JSON-RPC request parameters.', 0, $paramModel->getErrors());
        }

        return $paramModel;
    }