[Java][Jersey] Add support for BeanValidation @Valid annotation
Description
Java Jersey generator has same issue with https://github.com/swagger-api/swagger-codegen/issues/4738 (fixed by https://github.com/swagger-api/swagger-codegen/pull/7807 for jaxrs-cxf)
Without @Valid, constraint annotations will not be evaluated.
So we need to add not only constraint annotations such as @NotNull, but also @Valid.
openapi-generator version
current master (2d99836e9047d74e958910aca1aa38b34e584daa)
OpenAPI declaration file content or url
N/A
Command line used for generation
N/A
Steps to reproduce
just read the generated sample.
Related issues/PRs
- https://github.com/swagger-api/swagger-codegen/issues/4738
- https://github.com/swagger-api/swagger-codegen/pull/7807
Suggest a fix/enhancement
https://github.com/fujigon/openapi-generator/commits/feature/java-jersey-validation-pojos
Related issues/PRs
I think it was also reported here: https://github.com/swagger-api/swagger-codegen/issues/7651
Thanks for your investigation. I read it and yes, the issue you told seems the same problem.
My understanding is that the problem is still exist both in openapi-generator and swagger-codegen. I already filed a PR to fix this problem to openapi-generator project.
https://github.com/OpenAPITools/openapi-generator/pull/1019 Could you kindly review it?
Thanks!