title: REST uri naming conventions for junction tables
body: <p>Let's say I've three tables</p>
  
  <pre><code>product (id, name)
  customer (id, name)
  product_customer (product_id, customer_id)
  </code></pre>
  
  <p>I've following REST services (URI'S) already in place for the <code>product</code> and <code>customer</code></p>
  
  <pre><code>GET /products =&gt; get all products 
  GET /products/:id =&gt; get details on a specific product
  POST /products =&gt; add a product
  PUT /products/:id =&gt; update a product
  DELETE /products/:id =&gt; delete a product
  
  Same as above for /customers
  </code></pre>
  
  <p><strong>Question</strong></p>
  
  <p>Now join table <code>product_customer</code> needs a URI AND REST convention to retrieve records as per following needs</p>
  
  <p>a) <code>/product_customer</code>  (will pass <code>customer_id</code> param to get all products bought by the customer)</p>
  
  <p>b) <code>/product_customer</code> (will pass <code>product_id</code> param to get all customers who bought this product)</p>
  
  <p>I need a REST uri convention for join tables to be able to retrieve records by both params, is there any standard convention out there?</p>
  
  <p><strong>Edit Sample JSON</strong></p>
  
  <pre><code>{
    "products": [
      {
        "id": 1,
        "name": "product 1"
      }
    ],
    "customers": [
      {
        "id": 1,
        "name": "john"
      },
      {
        "id": 2,
        "name": "jane"
      },        
    ]
  }
  </code></pre>
  
  <p><strong>Edit 2 - Suggested URI's based on the comments</strong></p>
  
  <p><strong>Plural (with s)</strong></p>
  
  <p><code>GET /products</code> - List all products</p>
  
  <p><code>GET /products/1</code> - Detail like name etc. for the product id 1 (no customers)</p>
  
  <p><strong>Singular</strong></p>
  
  <p><code>GET /product/1</code> - Detail of a product plus it's customers</p>
  
  <p><code>GET /product/1/customers</code>  Only customers of product 1</p>