Repository navigation
fix: Fields with not null constraint annotations are considered optional if groups attribute is set - #4797
fix: Fields with not null constraint annotations are considered optional if groups attribute is set#4797T3rm1 wants to merge 1 commit into
Conversation
…nal if groups attribute is set
|
For reference: I've duplicate the concept in #4805 as I'd only checked for open issues, not PRs. My solution allows the calling code to override the filtering so that certain groups can be treated as being mandatory where required, and I think this solution PR is missing annotation on method parameters for JAXRS - see |
You might be right. I'll take a look. |
|
Hi, But just so that you know, there is also this pull-request that seemed to have implemented groups 2 years ago: Anyway, I think any fix on that subject would be very much appreciated. It would fix a lot of issues/questions raised by the community as we can see in the other PR. @frantuma What is your opinion on this issue ? |
|
This has been replaced by #4853 |
This PR keeps properties as optional when they are annotated with one of the not-null annoatations and have a value in their groups attribute.
The groups attribute lets you define under which circumstances the annotation is evaluated. For
NotNullthis means, the field can be optional in some cases and mandatory in other cases.Since we don't know what should apply, the parameter should be considered optional.
@frantuma It would greatly help me if we could merge this asap. I tried a few workarounds but none are fully working.