Make filterModel() in MappingJacksonJsonView more lenient [SPR-6470] #11136
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Milestone
Oliver Drotbohm opened SPR-6470 and commented
MappingJacksonJsonView
has a filter callback used to respectBindingResult
configuration applied to the model. It returns aMap<String, Object>
and the result of the filtering is directly passed to the underlyingObjectMapper
.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 JacksonObjectMapper
, 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
The text was updated successfully, but these errors were encountered: