I have problems to generate the MessageBodyReaderSupport and MessageBodyWriterSupport for List and List
I have the following Resource
class UserResource {
@POST
@Consumes('application/json')
@Produces('application/json')
List<User> getusers(List<UserDto> userlist) {
return userlist
}
}
I defined the MessageBodyWriterSupport for User and the MessageBodyReaderSupport for UserDto. I would expect that these reader and writer will be used when I use a collection typ like a List. But this is not the case I have to write my own reader and writer for
For example this:
@Provider
@Produces('application/json')
class ArrayListWriter extends MessageBodyWriterSupport<ArrayList> {
...
}
Can you please tell how I could write a MessageBodyReaderSupport and MessageBodyWriterSupport for a generic list class?
When I have MessageBodyWriterSupport for User and Item then it would be great when these writers are used when I generate List and List
Is this possible?
Would be great if you could post an example for that. Thank you for your help.