MappingJacksonJsonView extends MappingJackson2JsonView { @Override protected Object filterModel(Map<String, Object> model) { return (isFilterNeeded(model)) ? super.filterModel(model) : model; } MappingJacksonJsonView();   }
@Test public void testFilterData() throws Exception { MappingJacksonJsonView view = new MappingJacksonJsonView(); view.setModelKey("response"); view.setExtractValueFromSingleKeyModel(true); Map map = groovyMap("[response:[data:['foo','bar']]]"); Assert.assertEquals(view.filterModel(map), groovyMap("[data:['foo','bar']]")); map = groovyMap("[data:[response:['foo','bar']]]"); Object expected = view.filterModel(map); Assert.assertEquals(expected, groovyMap("[data:[response:['foo','bar']]]")); }