marshmallow-code / marshmallow-code/marshmallow

email validation should support single character TLDs

Open
#1,844 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
7.2k
Forks
738
Avg merge
1d 23h
Merged PRs (30d)
7

Description

Right now the email schema dont support single character TLDs:

from marshmallow import Schema, fields
class EmailSchema(Schema):
    email = fields.Email()

print(EmailSchema().validate({"email": "test@a.a"}))
#> {'email': ['Not a valid email address.']}

The above behavior is wrong since a.a is a valid TLD according to RFC-1123, Please see the stackoverflow thread: https://stackoverflow.com/questions/7411255/is-it-possible-to-have-one-single-character-top-level-domain-name/21872376#21872376

This validation should pass.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the fields.Email entry point shown in the report and trace the email validation rule that rejects test@a.a. Reproduce the example with EmailSchema, then update the validation so a single-character TLD passes while invalid addresses remain rejected.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.