-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[Jaxrs-cxf] Add bean-level cascaded beanvalidation for pojos (@Valid) #4738 #4922
base: master
Are you sure you want to change the base?
Conversation
@jfiala My take is that {{#isPrimitive}} should cover the following as well
so that the following should imply models:
|
This is exactly what I am using at pojo.mustache: {{^isPrimitiveType}}{{^isContainer}}{{#useBeanValidation}}
+ @Valid{{/useBeanValidation}}{{/isContainer}}{{/isPrimitiveType}} PrimitiveType covers only the real primitive types and container the List/Map items. |
@jfiala shouldn't |
@fehguy unfortunately not, see above listed mustache snippet, I actually used ^isPrimitiveType/^isContainer. |
I would rather update "isPrimitiveType" to include the additional items (e.g. uuid) you've listed. Ref: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types |
@wing328 any news about this PR? We also need this feature but seems that the PR is not yet merged / final. |
@olivierpaquet Thx for asking, but currently I'm too busy to rebase, if you like you can rebase and re-provide the PR. |
We were trying to use this plugin for open api 3, and the validation of cascading beans is failing as @Valid annotation is not added on cascaded pojos. |
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
and./bin/security/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates)2.3.0
branch for breaking (non-backward compatible) changes.Description of the PR
Implemented #4738 for CXF
Open issues:
@Valid is currently also generated for properties of type (isPrimitiveType/^isContainer does not cover these):
Please advise how we can best check for model-specific pojos?
In fact, there is only one valid @Valid-reference in Pet.java: