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

Exotic type for urls validation #236

Closed
Gr1N opened this Issue Jul 31, 2018 · 4 comments

Comments

2 participants
@Gr1N
Collaborator

Gr1N commented Jul 31, 2018

Hi,

In my projects I need to validate URLs. And I think that it's good to have such type in pydantic and I can port URLs validation logic from Django project.

@samuelcolvin what do you think?

@samuelcolvin

This comment has been minimized.

Owner

samuelcolvin commented Jul 31, 2018

👍

But are you sure we can't use stdlib urlparse?

A lot of django's extra stuff came about because it predated the equivalent feature in the stdlib; then they couldn't replace with the stdlib version as their's was slightly different.

@Gr1N

This comment has been minimized.

Collaborator

Gr1N commented Jul 31, 2018

We will use stdlib, but there a lot of extra stuff for example for IPv4 or IPv6. I can also look how URL validation implemented for example in marshmallow.

Below list of implementations I like:

@samuelcolvin

This comment has been minimized.

Owner

samuelcolvin commented Jul 31, 2018

There's also trafaret https://github.com/Deepwalker/trafaret/blob/master/trafaret/internet.py

I have no idea which is best.

@Gr1N

This comment has been minimized.

Collaborator

Gr1N commented Jul 31, 2018

I will try to review all of this first. I think we need something simple to support but useful for projects.

Gr1N added a commit to Gr1N/pydantic that referenced this issue Aug 19, 2018

Gr1N added a commit to Gr1N/pydantic that referenced this issue Aug 19, 2018

Gr1N added a commit to Gr1N/pydantic that referenced this issue Aug 19, 2018

samuelcolvin added a commit that referenced this issue Aug 20, 2018

add ``UrlStr`` and ``urlstr`` types #236 (#246)
fix #236

* add ``UrlStr`` and ``urlstr`` types #236

* review fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment