-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
Why custom annotations instead of JAX-RS (JSR-311) ones? #573
Comments
Because JAX-RS annotations are specific to configuring a server, not a client. There's all kinds of annotations which don't make sense in the context of a client ( I spent a few days researching this over a year ago back before we had our v1.0 and found all of the aforementioned problems. Ultimately the annotations were designed with only the concerns of a server, not a client, in mind. |
Note that JAX-RS 2.0 repurposed the annotations for use on client side, quite successfully. That doesn't make them a good fit for Retrofit anyway though. |
@simon-heinen did you found a way to reuse the interfaces? |
No but there are some possible ways: What you can do is create a version of retrofit where you modify the parser that it accepts both retrofit annotations and jax rs annotations which might be the best way or you add the retrofit annotations to your jax rs interfaces on the server side (which I wouldn't recommend;) |
What was the design decision not to use the JAX-RS (JSR-311) annotations and instead create custom ones?
I would like to share the REST interfaces between my backend and Android frontend to not write them twice but this isn't possible due to the custom annotations or am I wrong?
The text was updated successfully, but these errors were encountered: