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
Support for JSR-303 (Java Bean Validation) ? #356
Comments
In the very latest 0.8.6-SNAPSHOT, you can get JSR 303 validation working. Here is a sample controller: @RestController
} |
How does the Person looks like in your example?
|
It would be nice if it could handle this not only in the model, but for Query, Path, Matrix params as well. Also, it would nice if it would handle more than @NotNull and could handle the other annotations as part of the spec. See http://docs.oracle.com/javaee/7/api/javax/validation/constraints/package-summary.html Then, the clients of the swagger spec, such as the swagger-ui could validate the fields as they are entered without needing to make a call to the server. |
Relates to this issue: #311 As far as I can tell none of the JSR-303 constraint's are supported by springfox (including @NotNull). @jasonchaffee would you be interesting in contributing to your idea? |
I prefer this to be separate module Don't want it to be a concern in the core modules, just because it can be released incrementally and possibly out-of-band. |
I agree that it makes sense to be in a separate module.
|
If I can get some extra time I can take a stab at it. It isn’t a high priority for our use right now, so that might limit the time I will have to look into it. If that were to change, I would definitely take it on.
|
is the support for JSR-303 (Java Bean Validation) available ? |
I added a sample implementation of NotNull and Min/Max to issue #987. |
As of PR #1159 the annotations @NotNull, @min, @max, @SiZe are supported. Open questions:
|
Hi is there any support for JSR-303 (Java Bean Validation) ?
Given
A controller method
A command object
Swagger produces
But should be
I could add swagger annotations to MyDTO's fields, but then the NotNull/required logic would be duplicated and potentially leads to documentation inconsistence.
Thx for reading ;-)
The text was updated successfully, but these errors were encountered: