Suppress wrapper object when serializing Java object into JSON using Jackson

后端 未结 5 2306
忘掉有多难
忘掉有多难 2021-02-14 23:45

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:29

    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

提交回复
热议问题