Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Won't Fix
-
Affects Version/s: Upcoming
-
Fix Version/s: None
-
Component/s: Converters
-
Labels:None
Description
There's an issue with the JettisonMappedXmlDriver (actually it's in the Jettison project's JettisonMappedXmlDriver) when it converts objects with numeric fields (or boolean fields). It's quoting those fields instead of just putting in a JSON numeric/primitive literal.
This makes it more difficult to use the JSON output for web services, and also for converting back to Java objects using regular Java bean reflection (based on getter/setter methods).
See details in the Jettison JIRA:
http://jira.codehaus.org/browse/JETTISON-32
I've included a zip file containing the patched Jettison and XStream files.
Issue Links
- depends upon
-
JETTISON-32 MappedXMLStreamWriter quoting numeric values breaking JSON 2 Java deserialization Issue
I am not sure about this functionality. While XStream deals with typed objects, Jettison only recognizes String values. With your patch Jettison will always try to use a "better" type - even if the original type in the Java object was really a String. We'll see what the Jettison devs will say, XStream will use what they provide