Suppress wrapper object when serializing Java object into JSON using Jackson

后端 未结 5 2168
时光取名叫无心
时光取名叫无心 2021-02-15 00:02

I have a web service that returns a list as JSON. It uses Jackson to map a List of Java POJOs into JSON. The problem is that the JSON representation has a wrapper object around

5条回答
  •  無奈伤痛
    2021-02-15 00:23

    I get the same problem as you.

    After add @ResponseBody in front of my list in my method declaration, the problem was solved.

    eg :

    public @ResponseBody List getObject

提交回复
热议问题