title: Deserialize a non Specified Object with Jackson Library
body: <p>This relates to <a href="https://stackoverflow.com/questions/11865533/serialising-a-class-member-into-json-object">this</a> question but I want to deserialize rather than serialize</p>
  
  <p>I receive a json object from the server..</p>
  
  <p>One of the values in the json object can be either a string or a string array.</p>
  
  <p>It is possible to get this to work by defining a Object and casting it like so.</p>
  
  <pre><code>@JsonProperty("integration/enabled-mime-types") public Object object;
  
  List&lt;String&gt; list = (List&lt;String&gt;) object; 
  
  String string = (String) object;
  </code></pre>
  
  <p>However i would like to this as List rather than an object. The code I am using is this</p>
  
  <pre><code>@JsonDeserialize
  @JsonProperty("integration/enabled-mime-types")
  public void setMimeTypes(Object object) {
      if(object instanceof List) {
          this.mimeTypesArray =  (ArrayList&lt;String&gt;) object;
      } else {
          this.mimeTypesArray.add((String) object);
      }
  }
  </code></pre>
  
  <p>But the List is never set. How to go about this?</p>