title: REST API sub resources, data to return?
body: <p>If we have <code>customers</code> and <code>orders</code>, I'm looking for the correct RESTful way to get this data:</p>
  
  <pre><code>{
    "customer": {
      "id": 123,
      "name": "Jim Bloggs"
      "orders": [
        {
          "id": 123,
          "item": "Union Jack Keyring",
          "qty": 1
        }, {
          "id": 987,
          "item": "London Eye Ticket",
          "qty": 5
        }
      ]
    }
  }
  </code></pre>
  
  <ol>
  <li><code>GET /customers/123/orders</code></li>
  <li><code>GET /customers/123?inc-orders=1</code></li>
  </ol>
  
  <p>Am I correct that the last part/folder of the URL, excluding query string params, should be the resource returned..?</p>
  
  <p>If so, number 1 should only return order data and not include the customer data. While number 2 is pointing directly at customer <code>123</code> and uses query string params to effect/filter the customer data returned, in this case including the order data.</p>
  
  <p>Which of these two calls is the correct RESTful call for the above JSON..? ...or is there a secret number 3 option..?</p>