-
Notifications
You must be signed in to change notification settings - Fork 30
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
Consider not requiring for repositories to trigger bean validation by default #216
Comments
@dstepanov Hey, how are you? https://github.com/jakartaee/data/blob/main/spec/src/main/asciidoc/jakarta-ee.adoc |
Sorry, my knowledge of the Jakarta EE is limited. I just saw that note and assumed the repository should always check for validation. We actually removed the implicit validation in Micronaut 4. |
There is no sorry; we are here to learn together! What you said makes sense; it should not make this validation. I will create a PR explicating the integration which is not mandatory. It is possible and period. |
This is an excellent point from @dstepanov and I think we should look into doing the same in Jakarta Data. Regarding
so we should look into whether |
I sent a question to the Jakarta Bean Validation mailing list to check on our proposed usage of the |
…ion section Signed-off-by: Nathan Rauh <[email protected]>
Pull @231 corrects the validation sections in the spec based on current behavior of Jakarta Validation, which allows the |
To repeat my points from the email. In this scenario: class MyEntity {
}
interface MyRepository extends CrudRepository<@Valid MyEntity, @Min(0) Long> {
}
interface CrudRepository<E, ID> {
E findById(ID id);
} Annotations The annotations that should be bound only to the type argument are defined as |
I just tried out adding a constraint to the ID type variable as in your example. This doesn't seem to work either, suggesting that maybe the issue with Jakarta Validation is bigger than just |
@njr-11 @dstepanov could we close this issue? |
This kind of validation might be unwanted for performance reasons, or validation might have happened before and is unnecessary.
The latest version of Micronaut Data requires the repository type arguments to be annotated for the entity or ID to be validated:
The text was updated successfully, but these errors were encountered: