I am working with JSON oriented framework in Spring, we are using JSON lib to serialization of objects and collections.In my domain object i am having a ENUM type property. When i am map a JSON object to Bean object it is working fine(using toBean method), but i am sending back a Model Object to the client the ENUM not converting to JSON object, instead its showing ~unique~ for the corresponding property in the JSON object .
If anybody having solution please share it here.
I am using json-lib-2.2-jdk15.
Thanks in advance
Vijay Mohan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi guys,
I am working with JSON oriented framework in Spring, we are using JSON lib to serialization of objects and collections.In my domain object i am having a ENUM type property. When i am map a JSON object to Bean object it is working fine(using toBean method), but i am sending back a Model Object to the client the ENUM not converting to JSON object, instead its showing ~unique~ for the corresponding property in the JSON object .
If anybody having solution please share it here.
I am using json-lib-2.2-jdk15.
Thanks in advance
Vijay Mohan
Hi Vijay,
Have you tried registering an EnumMorpher? you could also register a custom morpher of your own to deal with this case if EnumMorpher is not enough.
Cheers,
Andres
Oops forgot to post a link to the faq where Enummorpher is shown
http://json-lib.sourceforge.net/faq.html#enum
Cheers,
Andres