-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Fixes #2719: Implement support for @NotBlank #2720
Conversation
I fixed the bots complaint's. Hopefull. |
One thing I've also noticed: Why have all the classes @component annotations when they are then declared in a module explicitly (and never picked up by a ComponentScan apparently)? |
Codecov Report
@@ Coverage Diff @@
## master #2720 +/- ##
============================================
+ Coverage 94.77% 94.79% +0.01%
- Complexity 3161 3179 +18
============================================
Files 354 357 +3
Lines 8057 8083 +26
Branches 608 611 +3
============================================
+ Hits 7636 7662 +26
Misses 271 271
Partials 150 150
|
Thank you for your PR! one of many!
I believe it started out as a component being scanned and it was better to be explicit. Do you have one in particular. |
} | ||
|
||
/** | ||
* read NotNull annotation |
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.
[nits] NotNull -> NotBlank?
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.
Thank you for catching that! @hokkun-dayo
Added initial support for bean validation 2.0 @notblank annotation.
This currently doesn't go beyond the same handling that @NotNull has, but I still split it out into separate plugins because it MIGHT be possible to extend this going forward.
Possible extensions are somehow setting minLength=1 (for strings) / minItems=1 (for collections), but I didn't find an easy way to get this through to the Swagger JSON through Springfox's internal model.
I also copied the unit tests for NotNull and adapted them accordingly.