I figured out how to do this. Actually the problem is that MappingJacksonJsonView has a map. Therefore, why does he return it that way{"FOO":{"field1":0,"field2":"value"}}
But if I set it up that way
<beans:bean class="org.springframework.web.servlet.view.json.MappingJacksonJsonView">
<beans:property name="extractValueFromSingleKeyModel" value="true" />
</beans:bean>
It serializes the object itself, not the entire map. Hope this helps someone else.
source
share