With Jackson, it's easy to disable all annotations for a given ObjectMapper
.
Is there a way to only disable one given annotation?
// disable all
ObjectMapper mapper = new ObjectMapper()
mapper.disable(MapperFeature.USE_ANNOTATIONS);
// disable one?
ObjectMapper mapper = new ObjectMapper()
mapper.disable(@JsonIgnore);
Using @JacksonAnnotationsInside
, I've defined a custom Jackson annotation and I only want it to be used in certain circumstances.