MongoAnnotationIntrospector annotationIntrospector = new MongoAnnotationIntrospector(context.getDeserializationConfig());
context.insertAnnotationIntrospector(annotationIntrospector);
// Only include non null properties, this makes it possible to use object templates for querying and
// partial object retrieving
context.getSerializationConfig().setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
context.getDeserializationConfig().addHandler(new ServerErrorProblemHandler());
context.addSerializers(new MongoJacksonSerializers());
context.addDeserializers(new MongoJacksonDeserializers());
}