Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it expected that email validation is a bit incomplete? #471

Closed
qrilka opened this issue Apr 4, 2024 · 3 comments · Fixed by #539
Closed

Is it expected that email validation is a bit incomplete? #471

qrilka opened this issue Apr 4, 2024 · 3 comments · Fixed by #539

Comments

@qrilka
Copy link

qrilka commented Apr 4, 2024

In https://github.com/Stranger6667/jsonschema-rs/blob/79e35a2012e49ee7af58c6f8b9b10ff2ff0b0dff/jsonschema/src/keywords/format.rs#L122-L140 I see that email validation doesn't check for non-printable characters and explicitly says that domain validation is not done

@Stranger6667
Copy link
Owner

That is deliberately simplistic, but I am open to extending it. From the spec:

When the implementation is configured for assertion behavior, it:
SHOULD provide an implementation-specific best effort validation for each format attribute defined below;
MAY choose to implement validation of any or all format attributes as a no-op by always producing a validation result of true;

@jqnatividad
Copy link
Contributor

Perhaps, as a feature, have extended email validation using https://github.com/johnstonskj/rust-email_address?

Also, with the custom keyword/format support, is there an ability to override the built-in keywords/formats should the user want a more robust implementation?

@Stranger6667
Copy link
Owner

Perhaps, as a feature, have extended email validation using https://github.com/johnstonskj/rust-email_address?

Great idea! I am inclined to have some "full" feature (enabled by default) that will include extra dependencies, mainly for format validation. This is basically the idea from #470 and there are no blockers to implement it and include a more robust email validation. I'd be happy to review a PR for this, otherwise, I'll take a look at it in a few weeks.

Also, with the custom keyword/format support, is there an ability to override the built-in keywords/formats should the user want a more robust implementation?

Yep, overridden keywords & formats have the preference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants