-
-
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
[Java][jaxrs-spec] Add option to use jakarta imports / namespace #13593
Conversation
Thanks for the PR but your commit (as shown in the Commits tab) is not linked to your Github account, which means this PR won't count as your contribution in https://github.com/OpenAPITools/openapi-generator/graphs/contributors. Let me know if you need help fixing it. |
can you please review the build failure when you've time? https://github.com/OpenAPITools/openapi-generator/actions/runs/3183660250/jobs/5383030061 |
i updated the author info, all build tests passed on circleCI |
Hi :-) right now, under ressources/JavaJaxRS are several independent (?) implementations. There is also one at the root level of this directory (is that still relevant?). Would it be necessary or desired to unify them somehow? (if yes, how?) @wing328 any chance to merge this PR? or is something missing? |
i solved the merge conflict. The failed circleci build on node1 is due to a java version mismatch. I think that this error is not due to this pr.
|
@thmue i have looked into the build problem a bit, and i am almost certain, that it is not due to this PR at all. I believe, the problem is with the pom template(s) missing a version field for the spring-boot-maven-plugin, which causes maven to pick 3.0.0, which again has transitive dependencies built for java 17. Try adding a version field in the template; modules/openapi-generator/src/main/resources/java-camel-server/pom.mustache Something like this;
This module is not the only place, i think, this problem exists. |
Thank you @shamus13 for debugging this issue. I added the spring version to the pom.xml (samples/server/petstore/java-camel/pom.xml ) Additionally, i added the fix also to the pom.mustache, however, this file does not influence the build @wing328 would it be possible to get this merged during the 6.3.0 merge window? |
Glad to be of help. Anything to get this merged. I really hope, @wing328 can find the time to have a look at this again. |
just ran into this on #14319 while working on typescript experimental, hoping it gets merged soon! |
It's been a while now, perhaps one the java team could have a look and help speed things along? @bbdouglas @sreeshas @jfiala @lukoyanov @cbornet @jeff9finger @karismann @Zomzog @lwlee2608 |
bin/configs/jaxrs-spec-ee.yaml
Outdated
@@ -0,0 +1,11 @@ | |||
generatorName: jaxrs-spec | |||
outputDir: samples/server/petstore/jaxrs-spec |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think the output folder cannot be the same. please change it to samples/server/petstore/jaxrs-spec-ee
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please also update .github/workflows/samples-jaxrs.yaml with the new output directory
bin/configs/jaxrs-spec-ee.yaml
Outdated
@@ -0,0 +1,11 @@ | |||
generatorName: jaxrs-spec | |||
outputDir: samples/server/petstore/jaxrs-spec | |||
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml (3.0 spec) for testing as we're moving away from 2.0 spec.
please also run |
@thmue looks like some github actions still failed: https://github.com/OpenAPITools/openapi-generator/actions/runs/3788726406/jobs/6441805752. Can you please take a look? The workflow uses JDK8. Do we need to test it with JDK11 instead? (there's another workflow to test with JDK11) |
it seems that recent versions of jakarta.ws.rs.* (3.1) are only build for 11+ see minimum version : https://jakarta.ee/specifications/restful-ws/3.1/ |
ok the builds pass now :-) |
https://github.com/OpenAPITools/openapi-generator/actions/runs/3788849502/jobs/6446526010 still failed. please take another look. Before this PR, the build of `samples/serer/petstore/jaxrs-spec) is perfectly fine with JDK8 tought. I'll another look later this week to see if I find out why. |
After generating the sample, three generated model classes
try to import:
Of course this package does not exist. I don't know where / why this import is generated. |
can you please resolve the merge conflicts when you've time? thanks. |
@thmue More information can be found here https://github.com/OpenAPITools/openapi-generator/blob/master/docs/generators/jaxrs-spec.md |
I use |
Support Jakarta EE in jaxrs-spec.
partially addresses:
#13124
#6881
To enable jakarta imports, set the additional property useJakartaEE to true.
If the option is false the legacy javax.* namespace is imported.
example:
java -jar ./openapi-generator-cli.jar generate -g jaxrs-spec --additional-properties=useJakartaEE=true
PR checklist
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*
.For Windows users, please run the script in Git BASH.
master
(6.1.0) (minor release - breaking changes with fallbacks),7.0.x
(breaking changes without fallbacks)