-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Fix duplicate import javax.valid.Valid in resteasy generator #19055
Conversation
mention |
@wing328 could you pls review? Thx |
thanks for the PR but I couldn't repeat the issue with the latest master using the follow command/test:
If I add Can you share with me a way to reproduce the issue? |
Sure! I have a reproducer here https://github.com/hamburml/quarkus-openapi-generator Just clone main, run mvn package and check the Order.java or Pet.java class. You should see one jakarta and one javax import. I am sorry, I haven't used the cli command, always the maven plugin. I tried your command but I do not know where the files are generated. |
modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pojo.mustache
Show resolved
Hide resolved
tested locally to confirm there's n duplicate import of javax.valid.Valid |
Thanks <3 I am not that versed with gradle but I could try to fix the example. The current example would always only work with javax and never with jakarta annotations because it forces java ee 8. |
Shall we set the source and target to JDK 11 if useJakrataEe is enabled? |
just tried it. no luck seems like something is fundamentally wrong, e.g.
missing import in pom.xml? |
Yeah, I think would be good. Jakarta EE 10 needs JDK 11 minimum. |
https://mvnrepository.com/artifact/jakarta.servlet/jakarta.servlet-api/6.1.0 that's the latest version but we're still using 4.x |
In the build.gradle of the generated example you need And I think some other dependencies are outdated. |
I ran
|
I wonder if you can help file a PR to update these dependencies 🙏 |
Had the same. Gradle v7 removed compile command. It is now implementation. |
I will try :) |
The reason is that some users prefer pom/maven while others prefer gradle. one can manually delete the one they don't need or ignore it in .openapi-generator-ignore: https://github.com/openapitools/openapi-generator/blob/master/docs/customization.md#ignore-file-format |
to reproduce the gradle issue, please run
please take your time. appreciate your help to improve the jaxrs-resteasy generator |
Fixes #17069
The resteasy generator generates
twice when useBeanValidation is enabled.
It is already added here https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/model.mustache#L12
PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*
.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master
(upcoming 7.6.0 minor release - breaking changes with fallbacks),8.0.x
(breaking changes without fallbacks)