Skip to content

Support for JSON API's Compound Documents #353

@alexchumak

Description

@alexchumak

Using combination of relationships and included related resources it is possible to avoid making many unnecessary API calls.

http://jsonapi.org/format/#document-compound-documents

"data": [
  {
    "id": "59d23d10-1aa3-11e5-8c51-f1d09152a8c3",
    "type": "activities",
    "attributes": {
      "ip": "x.x.211.243",
      "bot": false
    },
    "relationships": {
      "user_agent": {
        "data": {
          "type": "user_agents",
          "id": "1"
        }
      }
    }
  }
],
"included": [
  { "type": "user_agents", "id": "1", "attributes": { "os": "windows", "browser": "chrome" } }
]

After parsing that response activity.user_agent should be present, without any additional API calls.

Is there any appetite for adding this seemingly priceless functionality?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions