Validator class
This validator allows validating serialized (or deserialized) string parameter values.
Usage:
* Let validator = StrValidator()
then
* validator.validate('foo') -> 'foo'
* validator.validate('false') -> 'false'
* validator.validate(5) -> ValueError
* validator.validate(True) -> ValueError
Functions
Initialize self. See help(type(self)) for accurate signature.
Parameters:
Name | Type | Default value | Description |
---|---|---|---|
allowed_values | List | ||
min_length | int | ||
max_length | int |
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 |