title: Normalizing JSON API Standard v1
body: <p>I've been looking into <a href="https://github.com/gaearon/normalizr" rel="nofollow">normalizr</a> for flattening JSON API data formatted in the <a href="http://jsonapi.org/" rel="nofollow">standard JSON API format</a>. Can anyone point me to some examples of this being done? I am specifically getting hung up on how to handle the normalizr schema for the relationships of a resource object (as defined by the JSON API standard). In the JSON API standard, there is a "relationships" property defined within the resource object and then properties for each group of related objects. Here's an example of a single product category in the JSON API format with two related products:</p>
  
  <pre><code>{
    "jsonapi": {
      "version": "1.0"
    },
    "meta": {
      "time": "0.006"
    },
    "data": [
      {
        "type": "category",
        "id": "6",
        "attributes": {
          "name": "Odwalla"
        },
        "meta": {
          "product_count": "0"
        },
        "relationships": {
          "product": {
            "data": [
              {
                "type": "product",
                "id": "4785"
              },
              {
                "type": "product",
                "id": "4786"
              }
            ]
          }
        }
      }
    ],
    "included": [
      {
        "type": "product",
        "id": "4786",
        "attributes": {
          "name": "Strawberry &amp; Banana Odwalla",
          "description": null,
          "price": "3.19",
          "upc": ""
        }
      },
      {
        "type": "product",
        "id": "4785",
        "attributes": {
          "name": "Blueberry Odwalla",
          "description": null,
          "price": "3.19",
          "upc": ""
        }
      }
    ]
  }
  </code></pre>
  
  <p>The products contained within the category are listed under data.relationships.product.data and those product objects are included in the included array. I am sure there are a number of ways to normalize this; what would be the most effective and friendly way to flatten this for a Flux/Redux store?</p>