Base validator class
Base validator allows validating serialized (or deserialized) parameter values according to a
type
.
Usage: This class should not be used as it, but rather use to implement validator subclasses.
It provides the construction :meth:from_specs
to create usable basic validators.
:property type: The expected type of the value :type type: type
Functions
Initialize self. See help(type(self)) for accurate signature.
Parameters:
Name | Type | Default value | Description |
---|---|---|---|
type_ | Literal | ||
allowed_values | list |
Parameters:
Name | Type | Default value | Description |
---|---|---|---|
type_ | Union |
Valitates a value.
Parameters:
Name | Type | Default value | Description |
---|---|---|---|
value | Union | The value to validate an instance of `bool`, `int`, `float`, `str` or serilaizable `list`, `dict` |
Return type:
Any |