public Marshaller(boolean addtypeinfo) {
    if (addtypeinfo) {
      mapper_.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
    }
    mapper_.addHandler(
        new DeserializationProblemHandler() {

          @Override
          public boolean handleUnknownProperty(
              DeserializationContext ctxt,
              JsonParser jp,
              JsonDeserializer<?> deserializer,
              Object beanOrClass,
              String propertyName)
              throws IOException, JsonProcessingException {

            Log.error(
                "Ignoring unknown property [{}] while deserializing [{}]",
                propertyName,
                beanOrClass);

            return true;
          }
        });
  }
  /**
   * Create a BaseSpace session
   *
   * @param config the configuration to use to establish the session
   */
  public DefaultBaseSpaceSession(BaseSpaceConfiguration configuration, String accessToken) {
    this.configuration = configuration;
    this.accessToken = accessToken;
    mapper.addHandler(
        new DeserializationProblemHandler() {
          @Override
          public boolean handleUnknownProperty(
              DeserializationContext ctxt,
              JsonParser jp,
              JsonDeserializer<?> deserializer,
              Object beanOrClass,
              String propertyName)
              throws IOException, JsonProcessingException {
            logger.warning(
                "Ignoring unknown property '"
                    + propertyName
                    + "' when attempting to deserialize JSON to "
                    + beanOrClass.getClass().getName());
            return true;
          }
        });

    logger.setLevel(Level.WARNING);
  }