# Is my usage of nested relationships is right?

**URL:** <https://discuss.jsonapi.org/t/is-my-usage-of-nested-relationships-is-right/434>\
**Category:** Uncategorized\
**Created:** [April 19, 2016, 8:25am UTC](https://discuss.jsonapi.org/t/is-my-usage-of-nested-relationships-is-right/434 "2016-04-19T08:25:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![deividas](https://avatars.discourse-cdn.com/v4/letter/d/e19b73/32.png) [@deividas](https://discuss.jsonapi.org/u/deividas)\
**Post date:** [April 19, 2016, 8:25am UTC](https://discuss.jsonapi.org/t/is-my-usage-of-nested-relationships-is-right/434/1 "2016-04-19T08:25:50Z")

</div>

I have found similar topic ( [Is it ok to add multiple levels of nested relationships in the relationships field](http://discuss.jsonapi.org/t/is-it-ok-to-add-multiple-levels-of-nested-relationships-in-the-relationships-field/167/2) ) but missing part where I should put all includes it self from nested resources.

Please see example and suggest is it a valid way to represent such resources:

```
{
  "data": {
    "type": "category",
    "id": "5715e6649a892006ae7224f7",
    "attributes": {
      "name": "Category name"
    },
    "relationships": {
      "article": {
        "data": {
          "type": "article",
          "id": "56fab7f59a8920070e34bec8"
        }
      }
    }
  },
  "included": [
    {
      "type": "article",
      "id": "56fab7f59a8920070e34bec8",
      "attributes": {
        "name": "Article name"
      },
      "relationships": {
        "author": {
          "data": {
            "type": "author",
            "id": "56f90cf59a8920070e34bec7"
          }
        },
        "editor": {
          "data": {
            "type": "editor",
            "id": "56f93a469a8920070d466517"
          }
        }
      }
    },
    {
      "type": "author",
      "id": "56f90cf59a8920070e34bec7",
      "attributes": {
        "name": "MyName"
      }
    },
    {
      "type": "editor",
      "id": "56f93a469a8920070d466517",
      "attributes": {
        "name": "MyName"
      }
    }
  ]
}

```

Thanks!

---

<div class="post-metadata">

**Author:** ![ethanresnick](https://avatars.discourse-cdn.com/v4/letter/e/45deac/32.png) [@ethanresnick](https://discuss.jsonapi.org/u/ethanresnick)\
**Post date:** [April 20, 2016, 11:05am UTC](https://discuss.jsonapi.org/t/is-my-usage-of-nested-relationships-is-right/434/2 "2016-04-20T11:05:02Z")

</div>

Yes, the way you’ve done it is perfect

---

<div class="post-metadata">

**Author:** ![deividas](https://avatars.discourse-cdn.com/v4/letter/d/e19b73/32.png) [@deividas](https://discuss.jsonapi.org/u/deividas)\
**Post date:** [April 21, 2016, 10:44am UTC](https://discuss.jsonapi.org/t/is-my-usage-of-nested-relationships-is-right/434/3 "2016-04-21T10:44:48Z")

</div>

Thank you for taking a look!
