cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "KARR, DAVID (ATTCINW)" <dk0...@att.com>
Subject How to make clean json, instead of xml-ish json?
Date Thu, 01 Oct 2009 00:03:50 GMT
I have a REST prototype using CXF that produces reasonable looking XML,
and almost reasonably looking JSON.  The JSON it produces is "xml-ish".

For instance, the sample XML I get is the following:

<Item>
 <description>def</description>
 <features>
  <feature>123</feature>
  <feature>456</feature>
 </features>
 <id>1</id>
 <title>abc</title>
</Item>

The JSON is this:

{"Item":{"description":"def","features":{"feature":[123,456]},"id":1,"ti
tle":"abc"}}

A nicer JSON result would have been this:

{"Item":{"description":"def","features":[123,456],"id":1,"title":"abc"}}

Is it possible to modify just the JSON results, but still have the "out
of the box" XML results?

Mime
View raw message