cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject RE: How to make clean json, instead of xml-ish json?
Date Thu, 01 Oct 2009 16:27:37 GMT
> -----Original Message-----
> I have a REST prototype using CXF that produces reasonable looking
> and almost reasonably looking JSON.  The JSON it produces is
> 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:
> i
> tle":"abc"}}
> A nicer JSON result would have been this:
> }
> Is it possible to modify just the JSON results, but still have the
> of the box" XML results?

Related to this, I noticed the "Dealing with JSON array serialization
issues" section in the user guide.  I have a feeling this is telling me
that setting "serializeAsArray" and "arrayKeys" in my JSONProvider.  I'm
building a test for this now.  Even if this works, I'd have to say that
this documentation could use a clearer explanation of this, perhaps with
more fully-elaborated examples.  The documentation for this is quite
brief.  Full examples showing "before" and "after" would be useful.
There is a link to another example that supposedly provides more info,
but it only shows the beans.xml file, without any elaboration or

View raw message