使用Jackson,可以轻松禁用给定的所有注释ObjectMapper.有没有办法只禁用一个给定的注释?
// disable all
ObjectMapper mapper = new ObjectMapper()
mapper.disable(MapperFeature.USE_ANNOTATIONS);
// disable one?
ObjectMapper mapper = new ObjectMapper()
mapper.disable(@JsonIgnore);
Run Code Online (Sandbox Code Playgroud)
使用@JacksonAnnotationsInside,我已经定义了一个自定义杰克逊注释,我只希望它在某些情况下使用.