Issue #3643896: Allow empty and international email values in JSON Schema

Drupal.org issue: 3643896

The Email data type's schema rejects empty strings and international addresses accepted by Drupal when email formats are enforced.

Updates the schema to use anyOf with an empty-string alternative and format: idn-email. Optional values retain their existing null alternative.

Adds regression coverage for required and optional email values, including empty strings, ordinary addresses, international local parts and domains, and optional null.

Validation:

  • Email kernel test: 11 tests, 44 assertions passed.
  • Serialization kernel suite: 36 tests, 302 assertions passed.
  • Serialization unit suite: 186 tests, 547 assertions passed.
  • Complete code-quality checker: CSpell, PHPStan, and PHPCS passed.
  • git diff --check passed.

Separately verified six samples using Opis JSON Schema 2.6.3 with format assertions. The new schema accepts the empty and international samples and rejects the invalid-address sample. Opis was installed in a temporary Composer project for verification.

Generated with the help of an LLM.

Merge request reports

Loading
Loading