Fix broken unwrap bean validation and adapt tests#50
Fix broken unwrap bean validation and adapt tests#50wing328 merged 1 commit intoOpenAPITools:masterfrom MelleD:bugifx-49-JsonNullable-with-Collection-is-broken
Conversation
tofi86
left a comment
There was a problem hiding this comment.
Any chance to return the index of the invalid item in the persons collection as it was until now?
| 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.
@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