Description
Oliver Drotbohm opened SPR-6470 and commented
MappingJacksonJsonView
has a filter callback used to respect BindingResult
configuration applied to the model. It returns a Map<String, Object>
and the result of the filtering is directly passed to the underlying ObjectMapper
.
It would be cool if it was possible to reduce the return type to Object
as it would allow more sophisticated model filtering. E.g. the current implementation always hands a map to the Jackson ObjectMapper
, whereas it might be reasonable to just hand a single object to it. With the more lenient signature one could extract the single object from the model and only hand this to Jackson. In case you already return a container object from the list (e.g. to ensure correct list rendering in XML mapping) the JSON result is effectively wrapped twice (the actual container object + the map that results from Spring's model handling)
Affects: 3.0 RC2
Referenced from: commits cc32399