-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
[REQ] Disable TYPE_USE @Valid bean validation annotation #17874
Comments
Hi @jpraet, code generated by the
|
It's not really related to the JDK version, but rather to the Java EE / Bean Validation version. Java EE 7 / Bean Validation 1.1: https://docs.jboss.org/hibernate/beanvalidation/spec/1.1/api/javax/validation/Valid.html Anyway the generated server code indeed also specifies:
But I think many people, myself included, use the openapi-generator only for generating the model and api interfaces, and not for generating an entire project with maven pom.xml included. Besides, the bean validation dependency is provided-scoped, as it is indeed provided by the target application server. And unfortunately I still have to deal with some applications running on WebSphere 8.5 = Java EE 7. The bean validation annotations are also causing trouble in JBoss EAP 7.4 applications. There, it is not exactly caused by the TYPE_USE annotations themselves (as JBoss EAP 7.4 supports Java EE 8), but because these annotations are also placed on the final / private builder classes ( I have a PR #19580 open for that one. |
Is your feature request related to a problem? Please describe.
As of openapi-generator 7.2.0 the following code gets generated with the jaxrs-spec generator:
In openapi-generator 7.1.0 this was:
The
@Valid
annotation does not permit location TYPE_USE on Java EE 7 (bean-validation 1.1).This is only possible since Java EE 8 (bean-validation 2.0).
Describe the solution you'd like
Option to disable TYPE_USE
@Valid
annotation, or to configure the bean-validation version to use.The text was updated successfully, but these errors were encountered: