You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current validation error message: 'Not a valid URL.' is not descriptive enough to help the user, especially when they are passing a value that would appear to be a valid URL to most people, such as a docker hostname: http://test-url:8001
This is because fields.URL has a default: require_tld=True, for require_tld: Whether to reject non-FQDN hostnames.
FQDN = fully-qualified domain name. i.e. http://server1.example.com is a FQDN, http://server1 is not.
Suggestion: error message should be more descriptive when require_tld is True, and validation fails FQDN requirement.
The text was updated successfully, but these errors were encountered:
Hi @lafrech
Thanks - I took a swing at making a PR for it. Please take a look!
The main thing is just to improve "Not a valid URL" being a confusing message when inputting something that looks like a valid URL ...
If TLD is required, and "http://test-url" is passed, I set the error message to be: "URL must include a top-level domain (e.g., '.com', '.org')."
I wanted to include a note that it's because of the require_tld argument, which can be set to False, but obviously I don't think that's a helpful message for an end-user. Tricky balance to be helpful for developers, and not overly verbose for end-users.
So, it's just my initial attempt, and feedback is welcome!
ff137
added a commit
to ff137/marshmallow
that referenced
this issue
Oct 18, 2024
The current validation error message:
'Not a valid URL.'
is not descriptive enough to help the user, especially when they are passing a value that would appear to be a valid URL to most people, such as a docker hostname:http://test-url:8001
Sample code:
This is because fields.URL has a default:
require_tld=True
, forrequire_tld: Whether to reject non-FQDN hostnames.
FQDN = fully-qualified domain name. i.e.
http://server1.example.com
is a FQDN,http://server1
is not.Suggestion: error message should be more descriptive when require_tld is True, and validation fails FQDN requirement.
The text was updated successfully, but these errors were encountered: