# What's the correct way to specify Sparse Fieldsets for Deep Relationship Includes?

**URL:** <https://discuss.jsonapi.org/t/whats-the-correct-way-to-specify-sparse-fieldsets-for-deep-relationship-includes/1015>\
**Category:** Uncategorized\
**Created:** [June 30, 2017, 9:57pm UTC](https://discuss.jsonapi.org/t/whats-the-correct-way-to-specify-sparse-fieldsets-for-deep-relationship-includes/1015 "2017-06-30T21:57:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![forgivethefool](https://avatars.discourse-cdn.com/v4/letter/f/4da419/32.png) [@forgivethefool](https://discuss.jsonapi.org/u/forgivethefool)\
**Post date:** [June 30, 2017, 9:57pm UTC](https://discuss.jsonapi.org/t/whats-the-correct-way-to-specify-sparse-fieldsets-for-deep-relationship-includes/1015/1 "2017-06-30T21:57:54Z")

</div>

Hi

The specification is quite clear on the use of the include parameter - it clearly indicates that dot notation should be used to specify relationship paths, e.g. comments.author in the [#Spec: Fetching-includes](http://jsonapi.org/format/#fetching-includes) section

What the spec is not clear on how this translates to sparse fieldsets (i.e. no mention of dot notation).

For example, a contrived example

Which is more in-line with the specification, option 1 or option 2

1. GET  
/api/people  
?fields[people]=name,createdAt  
&fields[group]=name,budget  
&fields[group.division]=name,address  
&fields[group.division.managers]=name,telephone  
&include=group,group.division,group.division.managers
2. GET  
/api/people  
?fields[people]=name,createdAt  
&fields[group]=name,budget,[division.name](http://division.name),division.address,[division.managers.name](http://division.managers.name),division.managers.telephone  
&include=group,group.division,group.division.managers

Where a:

- A Person has a Group.
- Group has a Division
- Division has a list of Managers

Thanks  
~the fool

---

<div class="post-metadata">

**Author:** ![dgeb](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.jsonapi.org/dgeb/32/17_2.png) [@dgeb](https://discuss.jsonapi.org/u/dgeb)\
**Post date:** [July 2, 2017, 10:25am UTC](https://discuss.jsonapi.org/t/whats-the-correct-way-to-specify-sparse-fieldsets-for-deep-relationship-includes/1015/2 "2017-07-02T10:25:42Z")

</div>

Keep in mind that a single resource may be included via multiple relationship with multiple other resources, so there’s no practical way to specify a single set of fields via relationship.

Fields are instead specified by `type`, so you should have params like `fields[group]`, `fields[division]`, `fields[manager]`, etc.

---

<div class="post-metadata">

**Author:** ![forgivethefool](https://avatars.discourse-cdn.com/v4/letter/f/4da419/32.png) [@forgivethefool](https://discuss.jsonapi.org/u/forgivethefool)\
**Post date:** [July 3, 2017, 10:15am UTC](https://discuss.jsonapi.org/t/whats-the-correct-way-to-specify-sparse-fieldsets-for-deep-relationship-includes/1015/3 "2017-07-03T10:15:30Z")

</div>

Hi dgeb

Thanks for your response. Feels clean. I was just curious if the spec was going to become stricter in this regard and thought I’d cover that base now. First time I’m implementing the JSON API spec.
