Skip to content

Relationships not present in included resources #640

Description

@nickschot

When requesting to include records for relationships of the requested record (i.e. my-model?include=something1,something2, the relationships of those records are not included in the response.

I think this throws off at least ember-data a bit as it won't recognise any relationships for those records.

EDIT: some more information for this added below.

Example request:
GET /my-model/1?include=something

Example response from Lux (with the missing relationships for the records in "included"):

{
  "data": {
    "id": "1",
    "type": "my-model",
    "attributes": {
         ...
    },
    "relationships": {
      "something": {
        "data": {
          "id": "30",
          "type": "something"
        },
        "links": {
          "self": "http://localhost:5000/something/30"
        }
      }
    }
  },
  "included": [
    {
      "id": "30",
      "type": "something",
      "attributes": {
        ...
      },
      "links": {
        "self": "http://localhost:5000/something/30"
      }
    }
  ],
  "links": {
    "self": "http://localhost:5000/my-model/1?include=something"
  },
  "jsonapi": {
    "version": "1.0"
  }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions