Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

format: email rejects RFC 5321 Mailbox values when the TLD is not recognized

オープン
#28 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
java
領域
api, backend

調査の方向性

openapi-request-validator-core/pom.xml から始めて、フォーマットの経路を追跡します。つまり、NetworkNT の EmailFormat、IPv6AwareEmailValidator、Apache Commons EmailValidator、DomainValidator を通るメールアドレスの経路です。認識されない TLD を持つ構文的に有効なドメインに対する現在の動作を確認し、その後、IANA TLD 要件なしで RFC 5321 Mailbox 構文が受け入れられることを示すカバレッジを定義します。

索引モデルが issue の本文から書いたものです。

説明

Summary

format: email validation currently appears to reject email addresses whose domain has a syntactically valid top-level label but is not in the validator's recognized/IANA TLD list.

That seems stricter than the OpenAPI email format definition, which says that email is an email address as defined by the RFC 5321 Mailbox rule.

Example

Schema:

type: object
properties:
  email:
    type: string
    format: email
required:
  - email

Request body:

{
  "email": "[email protected]"
}

Actual result: validation fails.

Expected result: this should pass format: email syntax validation, because the domain part is syntactically valid under RFC 5321:

Mailbox = Local-part "@" ( Domain / address-literal )
Domain  = sub-domain *("." sub-domain)

RFC 5321 does not require the final label to be present in the IANA root zone or in an implementation-maintained TLD list for the address to match the Mailbox grammar.

Relevant code path

This seems to come from the Java validation stack rather than from OpenAPI itself:

  • openapi-request-validator-core/pom.xml depends on com.networknt:json-schema-validator.

  • NetworkNT’s com.networknt.schema.format.EmailFormat constructs:

    new IPv6AwareEmailValidator(true, true)
    
  • IPv6AwareEmailValidator extends Apache Commons Validator’s EmailValidator.

  • Apache Commons EmailValidator.isValidDomain(...) delegates to DomainValidator.

  • DomainValidator.isValid(...) checks that the domain has a recognized top-level domain via isValidTld(...).

  • DomainValidator documents this as validation of TLDs “as defined and maintained by the Internet Assigned Numbers Authority (IANA).”

Why this matters

This makes format: email unsuitable for some valid API inputs, including internal/test/private domains (with local DNS resolution).

Suggested fix

Please consider to configure the underlying email validator so format: email checks RFC 5321 Mailbox syntax without requiring a recognized/IANA TLD.

Thanks!

主要言語
Java
スター
16
フォーク
6
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

atlassian/openapi-request-validator のほかの issue

atlassian/openapi-request-validator の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。