-
Notifications
You must be signed in to change notification settings - Fork 31
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
Add support for Collection<JsonNullable<T>> in the JsonNullableValueExtractor #35
Conversation
…sonNullableValueExtractor
@tofi86 thanks for the PR, which looks good to me. |
@wing328 @vrnsky Thanks for approving and merging this patch. Unfortunately, right after your approval, we stumbled upon a severe issue with this earlier this week: Adding a container validation constraint like @Valid
@Size(min = 2)
private JsonNullable<Set<Person>> persons = JsonNullable.undefined(); fails the
The interesting part here is the Caused by:
It seems like adding the list elements manually to the validation processor (as this PR does) causes the Hibernate validator to apply the I did some debugging and research the past few days but cannot find a proper solution for this problem. Reverting my PullRequest leaves the list elements unvalidated (which, at least for me, isn't a proper solution) – and keeping the patch as it is causes container constraints like What are your thoughts about this problem? Maybe the original authors @hatzlj and @cbornet who discussed and implemented #2 have an opionion about this as well? Just to recap: The initial motivation for opening issue #34 and submitting this patch was the fact, that list elements wrapped in I would have expected that unwrapping doesn't prevent further list item validation, but as we see it does. And there also seem to exist a couple of restrictions with that as written in the "Known issues" section of the validator docs. Maybe this is a limitation we cannot work around? Maybe we need to find another solution for that problem? Sorry for the trouble! Looking forward to hearing your ideas about this... Best regards, |
No it crashes also without the This also crash
Without this change the @SiZe is working on the get method
|
This PR adds support for Collection<JsonNullable> in the JsonNullableValueExtractor.
closes #34