parameters-validation icon indicating copy to clipboard operation
parameters-validation copied to clipboard

Support for typing module in strongly_typed validation

Open roo-oliv opened this issue 6 years ago • 0 comments

Usage of the strongly_typed validation with types defined with typing module breaks validations.

We should add support to this and raise more appropriate errors when the type used is actually not supported.

from parameters_validation import validate_parameters, strongly_typed
from typing import Optional

@validate_parameters
def foo(a: strongly_typed(Optional[str]) = "default value"):
    print(a)
# Breaks and raises an obscure error

roo-oliv avatar Jun 10 '19 18:06 roo-oliv