Hi Jason,

First I'd ask myself if I'd really want this. The basic idea behind REST is 
that you address a resource, for which you might have several representations. 
Does not sound like you're doing that. 

If you find that you indeed need to do that, I suppose the easiest solution 
would be to have your method return a Response. 

Something like: 
  return Response.ok(A).build(); 
or: 
  return Response.ok(Bs).build(); 

Would do the trick, assuming that A and B have known representations.

Groeten,

Friso



-----Oorspronkelijk bericht-----
Van: Jason Novotny [mailto:jason.novo...@gmail.com] 
Verzonden: woensdag 14 augustus 2013 10:52
Aan: resteasy-users@lists.sourceforge.net
Onderwerp: [Resteasy-users] handling polymorphic rest request

Hi,

     I'm using RESTeasy with jackson and making a rest POST that either returns 
an object of type A or returns a list of objects of type B. How can I handle 
both of these cases? Do I need to override 
org.jboss.resteasy.client.core.BaseClientResponse? Any example would be much 
appreciated.

     Thanks, Jason



------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users

Reply via email to