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
Fix broken unwrap bean validation and adapt tests #50
Fix broken unwrap bean validation and adapt tests #50
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any chance to return the index of the invalid item in the persons collection as it was until now?
@@ -76,7 +75,7 @@ public void testUnwrapList() { | |||
assertEquals(3, validationResult.size()); | |||
assertTrue(validationResult.stream().anyMatch(c -> c.getPropertyPath().toString().equals("wheels[1].screws") && c.getConstraintDescriptor().getAnnotation().annotationType().getSimpleName().equals("NotNull"))); | |||
assertTrue(validationResult.stream().anyMatch(c -> c.getPropertyPath().toString().equals("wheels[3].screws") && c.getConstraintDescriptor().getAnnotation().annotationType().getSimpleName().equals("NotNull"))); | |||
assertTrue(validationResult.stream().anyMatch(c -> c.getPropertyPath().toString().equals("persons[0].role") && c.getConstraintDescriptor().getAnnotation().annotationType().getSimpleName().equals("NotNull"))); | |||
assertTrue(validationResult.stream().anyMatch(c -> c.getPropertyPath().toString().equals("persons[].role") && c.getConstraintDescriptor().getAnnotation().annotationType().getSimpleName().equals("NotNull"))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tofi86 No it's normal behavior of bean validation cause it's a Set
Same like:
Set<@Valid Person> persons = new HashSet<>();
It's not related to JsonNullable
No how i said it's normal behavior of bean validation into a Set |
@MelleD Thanks for your quick feedback. I wasn't aware of Set validation not returning the invalid index. I guess I'm fine with that then! :-) |
At least we got the index for |
:) |
if no further feedback, I'll merge it over the weekend and cut a release next week? |
Thanks for the PR, which has been merged. Will try to cut a release tomorrow. |
Released:
It may take sometime for the new release to be visible in https://search.maven.org |
@tofi86 @wing328
#49