def validate_method(self, method: Callable, params: Optional[Union[(list, dict)]], exclude: Iterable[str]=(), **kwargs: Any) -> Dict[(str, Any)]:
    '\n        Validates params against method using ``pydantic`` validator.\n\n        :param method: method to validate parameters against\n        :param params: parameters to be validated\n        :param exclude: parameter names to be excluded from validation\n\n        :returns: coerced parameters if `coerce` flag is ``True`` otherwise parameters as is\n        :raises: ValidationError\n        '
    signature = self.signature(method, exclude)
    schema = self.build_validation_schema(signature)
    params_model = pydantic.create_model(method.__name__, **schema, __config__=self._model_config)
    bound_params = self.bind(signature, params)
    try:
        obj = params_model(**bound_params.arguments)
    except pydantic.ValidationError as e:
        raise base.ValidationError(*e.errors()) from e
    return ({attr: getattr(obj, attr) for attr in obj.__fields_set__} if self._coerce else bound_params.arguments)
Validates params against method using ``pydantic`` validator.

:param method: method to validate parameters against
:param params: parameters to be validated
:param exclude: parameter names to be excluded from validation

:returns: coerced parameters if `coerce` flag is ``True`` otherwise parameters as is
:raises: ValidationError
def validate_method(self, method: Callable, params: Optional[Union[(list, dict)]], exclude: Iterable[str]=(), **kwargs: Any) -> Dict[(str, Any)]:
    '\n        Validates params against method using ``pydantic`` validator.\n\n        :param method: method to validate parameters against\n        :param params: parameters to be validated\n        :param exclude: parameter names to be excluded from validation\n\n        :returns: coerced parameters if `coerce` flag is ``True`` otherwise parameters as is\n        :raises: ValidationError\n        '
    signature = self.signature(method, exclude)
    schema = self.build_validation_schema(signature)
    params_model = pydantic.create_model(method.__name__, **schema, __config__=self._model_config)
    bound_params = self.bind(signature, params)
    try:
        obj = params_model(**bound_params.arguments)
    except pydantic.ValidationError as e:
        raise base.ValidationError(*e.errors()) from e
    return ({attr: getattr(obj, attr) for attr in obj.__fields_set__} if self._coerce else bound_params.arguments)