How can I deserialize JSON to a Map member variable using Jackson?

后端 未结 2 398
情歌与酒
情歌与酒 2021-01-17 16:55

I have some JSON I would like to map to my Boxobject:

  {
      \"created_date\": \"2015-11-11\",
      \"generation_date\": \"2015-11-12T20:35:         


        
2条回答
  •  醉梦人生
    2021-01-17 17:26

    I think you need to add an annotated argument to your constructor. For example,

    public Box(@JsonProperty("json") Map json) {
        // TODO
    }
    

提交回复
热议问题