users@jersey.java.net

Re: [Jersey] Can I suppress adding of _at_'s for attributes when generataing JSON from JAXB

From: Jakub Podlesak <Jakub.Podlesak_at_Sun.COM>
Date: Fri, 06 Nov 2009 17:42:28 +0100

On Fri, Nov 06, 2009 at 11:43:49AM +0000, Paul Taylor wrote:
> Paul Taylor wrote:
> >Using defaults I get:
> >
> >{"artist-list":{"@offset":"0","@count":"1","artist":{"@type":"group","@id":"8538e728-ca0b-4321-b7e5-cff6565dd4c0","@score":"100","name":
> >
> >"Depeche Mode","sort-name":"Depeche
> >Mode","life-span":{"begin":"1980"},"alias-list":{"alias":"Depech
> >Mode"}}}}
> >
> >but I've been asked for:
> >
> >{"artist-list":{"offset":"0","count":"1","artist":{"type":"group","id":"8538e728-ca0b-4321-b7e5-cff6565dd4c0","score":"100","name":
> >
> >"Depeche Mode","sort-name":"Depeche
> >Mode","life-span":{"begin":"1980"},"alias-list":{"alias":"Depech
> >Mode"}}}}
> >
> >Is there something I can change in my JSON configuration to do this.
> >
> >thanks Paul
>
> FYI, using natural() rather than mapped() solves the issue
>
> i.e return new JSONJAXBContext(JSONConfiguration.natural().build(),
> "org.musicbrainz.mmd2");
>
> might help if this difference was shown in the examples in
> https://jersey.dev.java.net/nonav/apidocs/1.1.1-ea/jersey/com/sun/jersey/api/json/JSONConfiguration.Notation.html

good suggestion, thanks, i will try to link the userdoc [1] from there.

~Jakub

[1]https://jersey.dev.java.net/documentation/1.1.3-ea/user-guide.html

>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>

-- 
Jakub Podlešák
Software Engineer at SUN Microsystems And CZJUG Co-Leader
http://blogs.sun.com/japod