-
Notifications
You must be signed in to change notification settings - Fork 237
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
Allow parsing jakarta.rs applications #645
Conversation
This situation with changed packages of JAX-RS is really unfortunate. Similar problem is with JAXB and JSON-B. To be honest I am not much happy with copy-paste solution. But currently I don't know how to deal with this situation. |
No, we're all quite unhappy about it. We could theoretically fix it using automatic code generation, but that's not straightforward to fix. The above mentioned repo recently also ended up merging the copy-paste-solution instead of the I think it's justified in this case since you can (theoretically) have a |
Dear Vojtěch, tested it and works for me, so I certainly wouldn't mind this being released. Thanks a lot! If you don't mind a proposal, I would probably have maintained to different set of annotations, to be chosen between based on the type of the We're having a flagday migration, so such edge cases don't affect me, but maybe there's someone else doing a piecewise migration? Well, it's probably not be worth the effort right now. Thanks again for the work, your generator is very helpful! If you happen to pass by Berlin, drop me a message for a beer ;) Best, |
Thanks for warm words 🙂 You are right that whole application should use either javax or jakarta annotations consistently. I tested how Jersey works and it really only considers annotations corresponding to one used on Application. But I hope it is not a big problem so I will release it as it is now and let's see if there is a demand for improvements. |
I migrated our application to the new jakarta.ws.rs namespace from the old javax.ws.rs and noticed the typescript-generator has not yet added support for it. So I went ahead and basically copied the javax scanner and parser along with the respective tests, making adjustments where necessary.
It's a bit of an ugly solution since it duplicates test and library code, and there are prettier solutions out there (e.g., FasterXML's jackson uses the maven-shading-plugin [1] and maven classifiers), but in this case, I found it worthwhile to support both jaxrs and jakarta from the same jar, in case a dependent application needs to generate TS from both specs at the same time, since they are not mutually exclusive.
FasterXML/jackson-datatypes-misc#11