podam icon indicating copy to clipboard operation
podam copied to clipboard

Add support for @Email with BeanValidationStrategy

Open msteiger opened this issue 3 years ago • 5 comments

Similar to #218 I think that a strategy for EMail strings should be implemented. The docs state that javax.validation.constraints are supported, but it does not yet work for @Email.

I could make a PR similar to what the email example in the docs suggest. Some Latin chars, the at-symbol, some Latin chars, dot, 2-3 Latin chars.

msteiger avatar Dec 19 '22 10:12 msteiger

Hi,

Email was added in Java EE 8, while, we still support only Java EE 7. This would require updating dependencies and drop of Java 6 and Java 7 support.

Thanks, Daniil

daivanov avatar Dec 25 '22 15:12 daivanov

Thanks for the clarification. What about adding the email validator to the package without tying it to the @Email annotation? A bit inconsistent maybe? But maybe helpful enough to be worth it?

I think that it's also possible to compile it properly with @Email annotation on Java 8+ and just set the "targetCompatibility" to 1.7. This should make it work correctly on Java 8 target systems but still be compatible with Java EE 7 (without the @Email functionality).

msteiger avatar Dec 28 '22 19:12 msteiger

Hi,

source and target are not working properly in Oracle Java compiler. Target just sets version to the bytecode without any validation. Then during execution one will get UnsupportedClassVersionError exception. This makes it extremely dangerous feature marginally being useless.

You could do PR and we can think how to merge it smartly.

Thanks, Daniil

daivanov avatar Dec 29 '22 15:12 daivanov

Fixed in Podam 8.0.0 or later

daivanov avatar Jul 28 '23 14:07 daivanov

Very nice! Thank you!

msteiger avatar Jul 30 '23 09:07 msteiger