title: How to create nested JSON response
body: <p>I am using spring-boot to handle exceptions and return timestamp, message and details.</p>
  
  <p>My exception class is as follows:</p>
  
  <p><a href="https://i.stack.imgur.com/iD4Su.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iD4Su.png" alt="enter image description here"></a></p>
  
  <p>My JSON response is:</p>
  
  <p><a href="https://i.stack.imgur.com/P879d.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/P879d.png" alt="enter image description here"></a></p>
  
  <p>My question is, how do I return:</p>
  
  <pre><code>Exception: {
      "timestamp": "2018-10-02T17:07:31.095+0000",
      "message": "id: 45267",
      "details": "uri=/v1/users/45267"
  }
  </code></pre>