title: How do I convert a json that contains a LocalDate field to deserializable format?
body: <p>I have an object stored in a String. One of the object's fields is a LocalDate.</p>
  
  <pre><code>"from": {
          "year": 1000,
          "month": "JANUARY",
          "era": "CE",
          "dayOfMonth": 1,
          "dayOfWeek": "WEDNESDAY",
          "dayOfYear": 1,
          "leapYear": false,
          "monthValue": 1,
          "chronology": {
              "calendarType": "iso8601",
              "id": "ISO"
          }
      }
  </code></pre>
  
  <p>How should I go about converting this json to a format that can be used for deserializing it?</p>
  
  <p>The following code</p>
  
  <pre><code>import com.fasterxml.jackson.databind.ObjectMapper;
  import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
  
  
  ObjectMapper om = new ObjectMapper();
  om.registerModule(new JavaTimeModule());
  MyCustomObject obj = om.readValue(json, MyCustomObject.class); //error
  </code></pre>
  
  <p>causes this Exception:</p>
  
  <pre><code>com.fasterxml.jackson.databind.JsonMappingException: Unexpected token (START_OBJECT), expected VALUE_STRING: Expected array or string.
  </code></pre>
  
  <p>Here's the MyCustomObject class which I use as MyCustomObject&lt;LocalDate&gt;</p>
  
  <pre><code>public class MyCustomObject&lt;T&gt; {
      private T from;
      private T to;
  
      public MyCustomObject() {
      }
  
      public T getFrom() {
          return this.from;
      }
  
      public void setFrom(T from) {
          this.from = from;
      }
  
      public T getTo() {
          return this.to;
      }
  
      public void setTo(T to) {
          this.to = to;
      }
  }
  </code></pre>