Request Params#

ValidParams#

type fitrequest.request_params.ValidParams = type[BaseModel] | list[str] | str | None#

Annotated type used for validation, coercion, and serialization of params models.

Utils and functions for validation#

fitrequest.request_params.extract_params(func: Callable, endpoint_varnames: set[str]) BaseModel | None[source]#

Extract the request parameters from the given function and return the corresponding Pydantic model for the fitrequest configuration. Return None if no parameters is found.

fitrequest.request_params.validate_init_value(value: Any) type[BaseModel] | None[source]#

Validate the provided parameters. If a string is given, attempts to retrieve the corresponding model from the global environment. If a list of fields’ names is supplied, dynamically create a Pydantic model to standardize the data type processed by fitrequest during method generation. Raise an InvalidParamsTypeError if the provided value has an incorrect type.