users@jersey.java.net

Re: [Jersey] Abstract JSON serialization problem in 1.1.2-ea

From: Amir RAminfar <findamir_at_gmail.com>
Date: Thu, 29 Oct 2009 08:12:53 -0700 (PDT)

What happened to this bug? I also have this problem.



Jakub Podlesak wrote:
>
>
> Matthew,
>
> could you please file this as a bug [1], and attach a simple reproducible
> test case,
> ideally a maven project.
>
> Thanks,
>
> ~Jakub
>
> [1]https://jersey.dev.java.net/issues
>
> On Wed, Sep 09, 2009 at 04:20:10PM -0600, Fetig, Matthew wrote:
>> We have just upgraded to 1.1.2-ea and are having problems with the JSON
>> output for an abstract object. Here is an example of the problem we are
>> having:
>>
>> Say you are serializing an object of type ShoppingCart. A shopping cart
>> contains a list of Items, which is an abstract object. When the
>> response is returned it has the implementation of item, but the JSON
>> produced is only serializing the information in the Item object and not
>> any of the attributes of the implementation of Item. I.E.:
>>
>> class Item{
>> public String itemNumber;
>> }
>>
>> class CD extends Item{
>> public String title;
>> }
>>
>> What is getting serialized:
>> {'items':[{'itemNumber':'156XC'}]}
>>
>> What should be serialized:
>> {'items':[{'itemNumber':'156XC', 'title':'Test CD'}]}
>>
>> This was working in the previous version we were using, but is no longer
>> working. We are using natural notation. Any insight you could provide
>> as how the renderer scans the classes for notations and how it decides
>> what to render would be appreciated.
>>
>> Matt Fetig
>> Lockheed Martin Integrated Systems & Global Services
>> Software Engineer
>> 9970 Federal Drive
>> Colorado Springs, CO 80921
>> Phone: 719.277.5718
>> E-mail: matthew.fetig_at_lmco.com<mailto:matthew.fetig_at_lmco.com>
>>
>
> --
> Jakub Podlešák, Software Engineer
> Web Services and Technologies, SUN Microsystems
> http://blogs.sun.com/japod
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>
>

-- 
View this message in context: http://n2.nabble.com/Abstract-JSON-serialization-problem-in-1-1-2-ea-tp3615096p3913226.html
Sent from the Jersey mailing list archive at Nabble.com.