users@jersey.java.net

Re: [Jersey] Controlling name of outermost tag when returning a list?

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 07 Oct 2009 10:51:06 +0200

Hi,

This is an open issue:

   https://jersey.dev.java.net/issues/show_bug.cgi?id=361

feel free to add your thoughts/opinions to it.

Paul.

On Oct 6, 2009, at 6:55 PM, Moises Lejter wrote:

> Given this example:
>
> ---cut here---
> @XmlRootElement(name="item")
> public class Value {
> public int id;
> }
>
> @Path("/list")
> public class Lister {
> @GET
> public List<Value> values() {
> return
> Collections.singletonList(new Value());
> }
> }
> ---cut here---
>
> I expected the returned list to have its outermost tag set to "items"
> but I get:
>
> <values>
> <item>
> <id>0</id>
> </item>
> </values>
>
> Is there a way to change that "values" to "items" ?
>
> Thank you!
>
> Moises
>