Skip to content

[feature] add non-exhausive URI validation #352

Closed
@yozachar

Description

@yozachar

Suggestions are welcome:

@validator
def uri(value: str, /):
"""Return whether or not given value is a valid URI.
Examples:
>>> uri('mailto:example@domain.com')
# Output: True
>>> uri('file:path.txt')
# Output: ValidationError(func=uri, ...)
Args:
value:
URI to validate.
Returns:
(Literal[True]): If `value` is a valid URI.
(ValidationError): If `value` is an invalid URI.
"""

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementIssue/PR: A new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions