How to use Jackson to deserialise an array of objects

前端 未结 8 1314
梦谈多话
梦谈多话 2020-11-21 22:58

The Jackson data binding documentation indicates that Jackson supports deserialising \"Arrays of all supported types\" but I can\'t figure out the exact syntax for this.

8条回答
  •  闹比i
    闹比i (楼主)
    2020-11-21 23:21

    From Eugene Tskhovrebov

    List myObjects = Arrays.asList(mapper.readValue(json, MyClass[].class))
    

    This solution seems to be the best for me

提交回复
热议问题