Spring 3 ArrayList serialization to JSON with Jackson without wrapping to object (without name)

前端 未结 1 969

I have simple resource which should return JSON array, but it returns object in which is array:

@RequestMapping(value = \"/types\", method = RequestMethod.GET)
          


        
1条回答
  •  抹茶落季
    2021-02-11 02:11

    In Spring 3.1, you should be able to set a property on the MappingJacksonJsonView bean called extractValueFromSingleKeyModel to true to remove the wrapper.

    Oh, seems like this has been asked before Why is Jackson wrapping my objects with an extra layer named after the class?

    0 讨论(0)
提交回复
热议问题