Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are the is_url and is_email functions correct? #317

Open
cuducos opened this issue Oct 3, 2021 · 0 comments
Open

Are the is_url and is_email functions correct? #317

cuducos opened this issue Oct 3, 2021 · 0 comments

Comments

@cuducos
Copy link
Contributor

cuducos commented Oct 3, 2021

The is_url and is_email in spidermon/contrib/validation/jsonschema/formats.py returns True is the input is anything but a string.

Thus, dict(), 42, [42, {}, ('a', 'tuple')] would all be valid emails or URLs according to these logic.

Shouldn't these files read like this instead?

    if not isinstance(instance, str_types):
        return False
    # …
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant