Support empty string with EmailStr validation
See original GitHub issueHello,
I configured the following field:
representative_email: EmailStr = None
When passing an empty string “” as value, I get the following error:
Email address is not valid (error_type=ValueError track=EmailStr)
How can I configure va validator to support those values a I can’t change the incoming format?
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Support empty string with EmailStr validation #181 - GitHub
Hello, I configured the following field: representative_email: EmailStr = None When passing an empty string "" as value, I get the following ...
Read more >Allow empty string for EmailAddressAttribute - Stack Overflow
You have two options: Convert string.Empty to null on the Email field. Many times that is perfectly acceptable.
Read more >Field Types - pydantic
pydantic supports many common types from the python standard library. ... EmailStr: requires email-validator to be installed; the input string must be a ......
Read more >email-validator - PyPI
A robust email address syntax and deliverability validation library for Python by Joshua Tauberer. This library validates that a string is of the...
Read more >Javascript for validating email used in a mapping Function.
Has anyone tried using Javascript within a function to validate if an email address is valid? ... public static boolean validateEmail(String emailStr) {....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For anyone curious on a working solution here:
Maybe you need
Optional[EmailStr]