Skip to content

Fix email validation#16

Merged
Krever merged 1 commit intomainfrom
fix-email-validation
Jan 22, 2026
Merged

Fix email validation#16
Krever merged 1 commit intomainfrom
fix-email-validation

Conversation

@Krever
Copy link
Collaborator

@Krever Krever commented Jan 22, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Improved email validation to use proper email format checking instead of an incorrect validation method, ensuring email addresses are validated accurately.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2026

📝 Walkthrough

Walkthrough

Email validation logic is updated in FormFromJsonSchema.scala by replacing Duration.parse-based checks with regex-based pattern validation. The emailRegex pattern is introduced and applied across two email format handling locations, improving validation accuracy without altering control flow.

Changes

Cohort / File(s) Summary
Email Validation Regex Replacement
forms4s-jsonschema/src/main/scala/forms4s/jsonschema/FormFromJsonSchema.scala
Replaces Duration.parse email validation with regex-based pattern matching. Updates FormatValidator label to "email" with sample value "user@example.com". Changes applied in two locations: case Some("email") branch and nested SchemaType.String email handling.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 An email hops where durations once crawled,
No parse errors shall make validation appalled,
A regex pattern, so crisp and so clean,
The finest email checker I've ever seen!
user@example.com bounces with glee,

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix email validation' clearly and directly describes the main change in the pull request, which is replacing email format validation from Duration.parse to a regex-based approach.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@Krever Krever merged commit f5f45ff into main Jan 22, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant