title: Build Spring ResponseEntity object from JSON string
body: <p>I have a valid JSON string of a <code>ResponseEntity.class</code>. Like this one:</p>
  
  <pre><code>{
      "headers": {
          "Location": ["/v1/books/12345"]
      },
      "body": {
          "id": 12345,
          "type": "BOOK",
          "address": {
              "address": "Some address",
              "city": "Some city"
          }
      },
      "statusCode": "CREATED",
      "statusCodeValue": 201
  }
  </code></pre>
  
  <p>I would like to create a <code>ResponseEntity.class</code> object from that string. I am using a standard Jackson mapper for that:</p>
  
  <pre><code>objectMapper.readValue(jsonString, ResponseEntity.class)
  </code></pre>
  
  <p>And get back a following error:</p>
  
  <pre><code>Can not construct instance of org.springframework.http.ResponseEntity: no suitable constructor found, can not deserialize from Object value (missing default constructor or creator, or perhaps need to add/enable type information?)
  </code></pre>
  
  <p>Indeed, when I checked the class, I did not see a default constructor there. How can I solve the issue and create an object?</p>