Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Having trouble with DEFAULT_VIEW_INCLUSION setting in jackson views

Tags:

java

json

jackson

The official docs on Jackson views at http://wiki.fasterxml.com/JacksonJsonViews says that you use this kind of line to exclude properties that are not explicitly mapped to a view.

objectMapper.configure(SerializationConfig.Feature.DEFAULT_VIEW_INCLUSION, false);

That is what I want to do -- but the line is not compiling for me. Anybody using this config directive?

like image 420
jomofrodo Avatar asked Aug 17 '12 22:08

jomofrodo


1 Answers

With the redesigns/refactorings of the 2.0 release, it got moved to MapperFeature.DEFAULT_VIEW_INCLUSION.

like image 132
Programmer Bruce Avatar answered Oct 17 '22 18:10

Programmer Bruce