users@jersey.java.net

Re: [Jersey] JSON Arrays

From: Lars Tackmann <lars_at_randompage.org>
Date: Mon, 11 Aug 2008 19:43:29 +0200

On Mon, Aug 11, 2008 at 5:46 PM, Jakub Podlesak <Jakub.Podlesak_at_sun.com> wrote:
> what if you left the fix in and just added another property to your custom
> context resolver:
>
> props.put(JSONJAXBContext.JSON_ROOT_UNWRAPPING, Boolean.FALSE);
>
> Does it work?

Thanks that did it:

it now rightly prints

--
{"users":null}
{"users":{"user":[{"id":"1","name":"user1"}]}}
{"users":{"user":[{"id":"2","name":"user2"},{"id":"1","name":"user1"}]}}
--
>
>
> Thanks for your patience and for letting us know there is an issue!
No problem, this issue actually turned out to have a positive spin of,
since it forced my front end people to use my XML model directly which
they pointed out was overly complex.
The problem is really that using the jersey client for testing JAXB
resources has become such a smooth experience that you completely
forget the complexity beneath. Quite a luxury problem and heads up to
you Sun people for creating this, I guess the old SOAP mantra of
writing  your functional tests in another programming language also
holds true for RESTful services -
Ohh well thats a good opportunity for writing my resource tests in
Ruby/rspec and running them in JRuby against a embedded Jetty server
(thus allowing me to get code coverage from a Ruby functional test).
Thanks for helping me out with this.
-- 
Yours sincerely
Lars Tackmann