Restlet, jackson and @JsonTypeInfo

2014-01-07 Thread Jon Finanger
Hi, I'm using POJOs and annotations with json. Using a arraylist in @Get (public ArrayListT myGet()), jackson serialize that as {name:DITest8,siteOwnerId:255,siteId:8,loca},{...} (using my webbrowser) On the clientside i therefore get the values in an arraylist with LinkedHashMap instead

RE: Restlet, jackson and @JsonTypeInfo

2014-01-07 Thread Jon Finanger
I was able to convert the LinkedHashMap values to ArrayListT using the ObjectMapper in my clientcode: ObjectMapper mapper = jacksonConverter.getObjectMapper(); ArrayListSiteDAO sites = mapper.convertValue(tmp, new TypeReferenceArrayListSiteDAO()

Re: Restlet, jackson and @JsonTypeInfo

2014-01-07 Thread Tim Peierls
One problem is that the generic type formal parameter T doesn't convey enough information for the annotation-based code to reconstruct the correct result type. Try creating a type that embeds the actual value of the type parameter, e.g., SiteDaoArrayList extends ArrayListSiteDAO (or

propagating conversion exception reason back to client in response body

2014-01-07 Thread Andy Dennie
If, during conversion of a request body, my converter's (subclass of ConverterHelper) toObject method identifies some problem with the structure or content of the body, I'd like to be able to return detailed information back to the client in the response body (e.g. missing field 'foo').

RE: propagating conversion exception reason back to client in response body

2014-01-07 Thread Andy Dennie
Hold on, it looks like there was an update to ConverterService about a year ago that addressed this (by no longer squelching the exception). It's just not in 2.1, which is what I'm using. Any chance it might be backported to 2.1? --

Re: Restlet, jackson and @JsonTypeInfo

2014-01-07 Thread Thierry Boileau
Hello, I think that the following will also work: @Get public ArrayListSiteDAO myGet() { ... } Best regards, Thierry Boileau 2014/1/7 Tim Peierls t...@peierls.net One problem is that the generic type formal parameter T doesn't convey enough information for the annotation-based code to