# Do JSONAPI allows Compound Documents return partial include's resource's attribute?

**URL:** https://discuss.jsonapi.org/t/do-jsonapi-allows-compound-documents-return-partial-includes-resources-attribute/1205
**Category:** Uncategorized
**Created:** [February 14, 2018, 6:06pm UTC](https://discuss.jsonapi.org/t/do-jsonapi-allows-compound-documents-return-partial-includes-resources-attribute/1205 "2018-02-14T18:06:07Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sanylcs](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@sanylcs](https://discuss.jsonapi.org/u/sanylcs)
#### Post date: [February 14, 2018, 6:06pm UTC](https://discuss.jsonapi.org/t/do-jsonapi-allows-compound-documents-return-partial-includes-resources-attribute/1205/1 "2018-02-14T18:06:07Z")

</div>

For example, when request through [http://example.com/articles/1](http://example.com/articles/1) return this:

```
{
  "data": {
    "type": "articles",
    "id": "1",
    "attributes": {
      "title": "JSON API paints my bikeshed!"
    },
    "links": {
      "self": "http://example.com/articles/1"
    },
    "relationships": {
      "author": {
        "links": {
          "self": "http://example.com/articles/1/relationships/author",
          "related": "http://example.com/articles/1/author"
        },
        "data": { "type": "people", "id": "9" }
      }
  },
  "included": [{
    "type": "people",
    "id": "9",
    "attributes": {
      "first-name": "Dan",
      "last-name": "Gebhardt",
      "twitter": "dgeb"
    },
    "links": {
      "self": "http://example.com/people/9"
    }
  }]
}

```

But when request using [http://example.com/people/9](http://example.com/people/9) get this NOTE: with facebook:

```
{
  "data": {
    "type": "people",
    "id": "9",
    "attributes": {
      "first-name": "Dan",
      "last-name": "Gebhardt",
      "twitter": "dgeb",
      "facebook": "123"
    },
    "links": {
      "self": "http://example.com/people/9"
    }
  }
}

```

Is the first response valid?

---

<div class="post-metadata">

### Author: ![michaelhibay](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.jsonapi.org/michaelhibay/32/405_2.png) [@michaelhibay](https://discuss.jsonapi.org/u/michaelhibay)
#### Post date: [February 17, 2018, 1:51pm UTC](https://discuss.jsonapi.org/t/do-jsonapi-allows-compound-documents-return-partial-includes-resources-attribute/1205/2 "2018-02-17T13:51:21Z")

</div>

Yes, the first response is valid. As the API designer, you have all the flexibility you need to return partial representations of included resources. Best practice would probably be to return the full representation unless you have a compelling reason not to return it. However, as far as the specification is concerned I would say the first is completely valid.
