@Produces collection in JAXRS / RestEasy
I found some strange behaviour that I cannot understand. I have tested 4 similar examples: 1 @GET @Produces(MediaType.APPLICATION_JSON) public Response produce() { List<Book> books = Arrays .asList(new Book[] { new Book("aaa", "AAA", "12345"), new Book("bbb", "BBB", "09876") }); return Response.ok(books).build(); } 2 @GET @Produces(MediaType.APPLICATION_JSON) public List<Book> produce() { List<Book> books = Arrays .asList(new Book[] { new Book("aaa", "AAA", "12345"), new Book("bbb", "BBB", "09876") }); return books; } 3 @GET @Produces(MediaType.APPLICATION_XML) public List<Book> produce() {