jackson - Collection Wrapper as JSON List? -


i need wrap list<something> in dto (say, wrapper) custom annotations work expected. end this:

public class wrapper {     private list<something> list;      @customannotationshere     public list<something> getlist() { ... }      public void setlist(list<something> list) { ... } } 

however, makes jackson serialize/deserialize wrapper object as

{   "list": [...] } 

which, imho, verbose , unnecessarily complex. there way have jackson serialize/deserialize wrapper object list (the value of list field)?

i swear once came across annotation-based way of achieving this, @ moment can't recall where.

add @jsonvalue field serialization, , single-argument constructor deserialization?


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -