Skip to content

Support for typing module in strongly_typed validation #4

@roo-oliv

Description

@roo-oliv

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestThis issue requests a new feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions