title: Restlet/Jackson JSON wrapper for ArrayList<Profile>
body: <p>i'm using the Restlet library for a WS server and i've recently switched from XStream/Jettison to Jackson as a JSON serializer/deserializer because of some issues.</p>
  
  <p>A first drawback is that my ArrayList&lt; Profile > (previously a Vector with Jettison) it doesn't wrap the list of Profiles when serialized and the JSON instead of "Profile:[{firstProfile}, {secondProfile}]" it looks like: [{firstProfile}, {secondProfile}]</p>
  
  <p>I can overcome to this issue in the client telling manually which is the correct mapping but i would prefer to use a KVC approach.</p>
  
  <p>I've looked around and it seems that it's a known issue: <a href="http://wiki.fasterxml.com/JacksonPolymorphicDeserialization" rel="nofollow">http://wiki.fasterxml.com/JacksonPolymorphicDeserialization</a> (5.1 Missing type information on Serialization) that it suggest to:</p>
  
  <ul>
  <li>Use arrays instead of Lists</li>
  <li>Sub-class list, using class MyPojoList extends ArrayList { }</li>
  <li>Force use of specific root type</li>
  </ul>
  
  <p>the simplest way it should be to return an "Profile[] profile" array but it seems not working, before trying the other solutions i've rechecked around and it seems that you can use a @XmlRootElement(name = "Profile") to wrap the JSON root element: <a href="http://jira.codehaus.org/browse/JACKSON-163?focusedCommentId=213588&amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-213588" rel="nofollow">http://jira.codehaus.org/browse/JACKSON-163?focusedCommentId=213588&amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-213588</a></p>
  
  <p>so for using JAXB annotations with Jackson you need to configure the objectMapper: <a href="http://wiki.fasterxml.com/JacksonJAXBAnnotations" rel="nofollow">http://wiki.fasterxml.com/JacksonJAXBAnnotations</a> </p>
  
  <p>but in restlet to do so you need to override createObjectMapper to pass a Custom converter (see: <a href="http://restlet-discuss.1400322.n2.nabble.com/Set-custom-objectMapper-to-Jackson-Extension-td6287812.html" rel="nofollow">http://restlet-discuss.1400322.n2.nabble.com/Set-custom-objectMapper-to-Jackson-Extension-td6287812.html</a> and <a href="http://restlet-discuss.1400322.n2.nabble.com/Jackson-Mix-in-Annotations-td6211060.html#a6231831" rel="nofollow">http://restlet-discuss.1400322.n2.nabble.com/Jackson-Mix-in-Annotations-td6211060.html#a6231831</a>)</p>
  
  <p>this is what i'm trying now! the question is there a more straightforward way to achieve this??</p>
  
  <p>Thanks!!</p>