users@jersey.java.net

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

From: Felipe Gaucho <fgaucho_at_gmail.com>
Date: Fri, 6 Nov 2009 13:05:01 +0100

Where to configure this?

Sent from my iPhone

On 06.11.2009, at 12:43, Paul Taylor <paul_t100_at_fastmail.fm> 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
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>