title: How to set format of string for java.time.Instant using objectMapper?
body: <p>I have an entity with <code>java.time.Instant</code> for created data field:</p>
  
  <pre><code>@Getter
  @Setter
  @AllArgsConstructor
  @NoArgsConstructor
  @EqualsAndHashCode
  public class Item {
      private String id;
      private String url;
      private Instant createdDate;
  }
  </code></pre>
  
  <p>I am using <code>com.fasterxml.jackson.databind.ObjectMapper</code> to save item to Elasticsearch as JSON:</p>
  
  <pre><code>bulkRequestBody.append(objectMapper.writeValueAsString(item));
  </code></pre>
  
  <p><code>ObjectMapper</code> serializes this field as an object: </p>
  
  <pre><code>"createdDate": {
      "epochSecond": 1502643595,
      "nano": 466000000
  }
  </code></pre>
  
  <p>I was trying the annotation <code>@JsonFormat(shape = JsonFormat.Shape.STRING)</code> but it doesn't work for me.</p>
  
  <p>My question is how I could serialize this field as <code>2010-05-30 22:15:52</code> string?</p>