Closed
Labels
enhancementIssue/PR: A new featureIssue/PR: A new feature
Description
- Succeeds:
Suggestions are welcome:
validators/src/validators/uri.py
Lines 24 to 41 in cdc987d
| @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
Labels
enhancementIssue/PR: A new featureIssue/PR: A new feature
Activity
tofetpuzo commentedon Jun 23, 2024
are you taking any new suggestions?
nandgator commentedon Jun 24, 2024
Constructive ones, please go ahead.
tofetpuzo commentedon Jun 24, 2024
--- # Define a list of valid URI schemes => VALID_SCHEMES = ['http', 'https', 'ftp', 'mailto', 'file']
tofetpuzo commentedon Jun 26, 2024
is it something we should do?
nandgator commentedon Jun 27, 2024
Something similar yeah.
tofetpuzo commentedon Jul 3, 2024
can I take up the challenge :)?
nandgator commentedon Jul 4, 2024
Sure, go ahead.
tofetpuzo commentedon Jul 9, 2024
Hey @yozachar ,can we use socket.inet_aton(ip) in python to validate ip addresses as a function then update the schema in uri.py?
nandgator commentedon Jul 10, 2024
IP addresses are already validated in
ip_address.py. Why usesocket.inet_aton?tofetpuzo commentedon Jul 10, 2024
Hi, that is cool I looked at the message thread, something about this error below , was why I thought this feature was asked for I guess, see code below.
Output:
ValidationError(func=url, args={'value': 'rtmp://192.168.1.123:1935/live/test'})
Or does it mean we just want to validate other schemas? like the ones few ones below, that I could not find in uri.py
proposed schemas
Few Thoughts
e.g