Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
FR: Consider adding 'email' as a core type #29
It'd be useful if cerberus had 'email' as a core type so users don't have to find a regex to validate emails, etc. It's just a small thing to do, but given how almost every web app will want to validate email addresses, it'd speed up using the library if it was core type. Otherwise users have to learn how to add custom types, write a regex, etc. Adding a 'regex' parameter to the string type would also be useful.
Just a small thing, but I think it'd be helpful.
Yeah I agree that it would be nice to have. Only problem being, no matter how good the regex people will always complain that it isn't good enough :)
This is one of those fields where I feel that customization comes in really handy, as anyone can work out his/her own use case, relying on email validatio APIs included (you could call the API in your custom validation function for example).
Of course we could still provide a standard email validation rule, which people could then choose to override if so they wish. A standard email validation rule would also be nice to have in Eve.
I agree. A standard email validator would let people get up-and-running quickly. If it took a regex as a parameter then people could override that as necessary.
I also think that a regex attribute on the string validator could be useful - in fact, the email validator could then just call the string validator and supply a default email regex.
BTW - Mailgun released their validation tool: https://github.com/mailgun/flanker