title: Convert JSON String to JAVA POJO using annotations in Spring
body: <p>Trying to parse the string JSON response to JAVA POJO using Jackson annotation in Spring boot application.</p>
  
  <p>POJO</p>
  
  <pre><code>@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY )
  @JsonRootName(value = "data")
  public class Data {
   @JsonProperty("ticket")
  private String ticket;
  
  public String getTicket() {
      return ticket;
  }
  
  public void setTicket(String ticket) {
      this.ticket = ticket;
  }
  
  @Override
  public String toString() {
      return "\"data:\"{" + "\"ticket\"=\"" + ticket + "\"}";
  }
  }
  </code></pre>
  
  <p>Retrieving the ticket from third party API using postForEntity as follows</p>
  
  <pre><code>ResponseEntity&lt;String&gt; response  = restTemplate.postForEntity(url, entity, String.class);
  </code></pre>
  
  <p>However, the third party API sends JSON in string format.</p>
  
  <p>Want to convert this JSON string to JAVA POJO using Jackson annotations.</p>
  
  <p>So that the call to API would become </p>
  
  <pre><code>ResponseEntity&lt;Data&gt; response  = restTemplate.postForEntity(url, entity, Data.class);
  </code></pre>
  
  <p>Any help would be appreciated.</p>
  
  <p>Thanks!</p>