You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by arjun dhar <dh...@yahoo.com> on 2017/09/06 05:41:34 UTC

ResponseBuilder interfering with true return type : Impacts Swagger

Hi,

I am using Swagger for documentation. Tough, that aside I do not wish my
method return type to be a "Response" type; rather the true type so its
legible to document and see.

However I do want Cache control on some end points. All documentation Ive
seen points to be using a ResponseBuilder, as there no
annotation/declarative way of handling this more cleanly?

thanks,
Arjun



--
Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html

Re: ResponseBuilder interfering with true return type : Impacts Swagger

Posted by Sergey Beryozkin <sb...@gmail.com>.
For some reason I'm finding these messages in the spam folder...

Sorry. I don't  understand what you mean below.
If you prefer to return JAX-RS Response then there must be a way to tell 
Swagger what the entity type is and this is why Swagger annotations have 
to be used in such cases.

Sergey
On 07/09/17 05:13, arjun dhar wrote:
> Hmmm thats what I feared, but thank you.
> 
> Out of technical curiosity. There is something pristine about method
> signature, and should not CXF allow to preserve that sugar and provide its
> annotation(s) to allow the response be wrapped in a ResponseBuilder for the
> other classes down the layer to implemented.
> 
> For example Spring does this beautifully using `@Cache` etc. To alter a
> signature based on trivial things like cache or no cache seems a bit ugly to
> me. Not a big deal .. but just trying to understand.
> 
> If this is discussed, would love if I can be pointed to any discussion
> existing around it.
> 
> thank you for your response.
> 
> 
> 
> --
> Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html
> 

Re: ResponseBuilder interfering with true return type : Impacts Swagger

Posted by arjun dhar <dh...@yahoo.com>.
Hmmm thats what I feared, but thank you.

Out of technical curiosity. There is something pristine about method
signature, and should not CXF allow to preserve that sugar and provide its 
annotation(s) to allow the response be wrapped in a ResponseBuilder for the
other classes down the layer to implemented. 

For example Spring does this beautifully using `@Cache` etc. To alter a
signature based on trivial things like cache or no cache seems a bit ugly to
me. Not a big deal .. but just trying to understand.

If this is discussed, would love if I can be pointed to any discussion
existing around it.

thank you for your response.



--
Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html

Re: ResponseBuilder interfering with true return type : Impacts Swagger

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

In this case I believe you need to use Swagger annotations, see this 
example:

https://github.com/apache/cxf/blob/master/distribution/src/main/release/samples/jax_rs/description_swagger2/src/main/java/demo/jaxrs/swagger/server/Sample.java#L61

Sergey

On 06/09/17 06:41, arjun dhar wrote:
> Hi,
> 
> I am using Swagger for documentation. Tough, that aside I do not wish my
> method return type to be a "Response" type; rather the true type so its
> legible to document and see.
> 
> However I do want Cache control on some end points. All documentation Ive
> seen points to be using a ResponseBuilder, as there no
> annotation/declarative way of handling this more cleanly?
> 
> thanks,
> Arjun
> 
> 
> 
> --
> Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html
> 


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/