code: public static SimpleModule getModule(final ObjectMapper mapper) {
          SimpleModule module = new SimpleModule();
          module.setDeserializerModifier(new BeanDeserializerModifier() {
              @Override
              public JsonDeserializer<?> modifyDeserializer(DeserializationConfig config, BeanDescription beanDesc, JsonDeserializer<?> deserializer) {
                  for (Class<?> c : TypeToken.of(beanDesc.getBeanClass()).getTypes().classes().rawTypes()) {
                      Field[] fields = c.getDeclaredFields();
                      for (Field field : fields) {
                          if ("additionalProperties".equalsIgnoreCase(field.getName())) {
                              JsonProperty property = field.getAnnotation(JsonProperty.class);
                              if (property != null && property.value().isEmpty()) {
                                  return new AdditionalPropertiesDeserializer(beanDesc.getBeanClass(), deserializer, mapper);
                              }
                          }
                      }
                  }
                  return deserializer;
              }
          });
          return module;
      }
docs: Gets a module wrapping this serializer as an adapter for the Jackson
  ObjectMapper.
  
  @param mapper the object mapper for default deserializations
  @return a simple module to be plugged onto Jackson ObjectMapper.