Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Resource interface with generated return types instead of Response #410

Open
coenvl opened this issue Oct 11, 2019 · 1 comment
Open

Resource interface with generated return types instead of Response #410

coenvl opened this issue Oct 11, 2019 · 1 comment

Comments

@coenvl
Copy link

coenvl commented Oct 11, 2019

I am using the raml-to-jaxrs plugin to generate code for both a server and a client. However, I am having some difficulty to create the client code. Partially this is because the functions of the interfaces do not return the actual return types, but a response object wrapped around the return entity.

Is it possible to generate the interfaces where the return types are from the generated model classes? This could be used by the client, but also by a jersey server.

I tried looking at raml-to-pojo, but I found it does not generate any interfaces for the resource locations, and even if it would, I suppose it would not annotate them with the jax-rs annotations, since I still do need those.

What I did come up with is use the generated server code at the client side, and use reflection to figure out what "respond200WithXXX" builder I should use. This does create a valid response object, but then still I end up with an OUTbound response which is of no use for the client.

@jpbelang
Copy link
Contributor

jpbelang commented Nov 5, 2019

Just adding something for the command line and a quick example. This should be closed today

jpbelang added a commit that referenced this issue Nov 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants