title: Should REST API return nested objects or links to that objects?
body: <p>What is the best practice in relation to this? Can you say that it depends on the application or is there any recommendation that indicates that one option is better than another?</p>
  
  <p>The two options are as follows:</p>
  
  <p>1 - Return nested objects</p>
  
  <pre><code>{
    "id": 1,
    "title": "Game A",
    "developer": "Developer DEF",
    "releaseDate": "2015-01-01",
    "platforms": [
      {"id":1,"name":"Xbox"},
      {"id":2,"name":"Playstation"}
    ]
  }
  </code></pre>
  
  <p>2 - Return links to that objects</p>
  
  <pre><code>{
    "id": 1,
    "title": "Game A",
    "developer": "Developer DEF",
    "releaseDate": "2015-01-01",
    "platforms": [
      {"_self": "http://api.example.com/games/1/platforms/53"},
      {"_self": "http://api.example.com/games/1/platforms/34"},
    ]
  }
  </code></pre>