Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data member isn't present when fetching a relationship #22

Closed
kocsismate opened this issue May 3, 2016 · 1 comment
Closed

Data member isn't present when fetching a relationship #22

kocsismate opened this issue May 3, 2016 · 1 comment
Assignees
Labels
Milestone

Comments

@kocsismate
Copy link
Member

kocsismate commented May 3, 2016

As found by @emil-nasso in #20 when visiting the following example url: ?path=/users/2/relationships/contacts, the data member doesn't show up:

{
  "links": {
    "related": "/?path=/users/2/contacts",
    "self": "/?path=/users/2/relationships/contacts"
  }
}

However, when including the relationship in question: ?path=/users/1/relationships/contacts&include=contacts it will be visible:

{
  "links": {
    "related": "/?path=/users/1/contacts",
    "self": "/?path=/users/1/relationships/contacts"
  },
  "data": [
    {
      "type": "contact",
      "id": "100"
    },
    {
      "type": "contact",
      "id": "101"
    },
    {
      "type": "contact",
      "id": "102"
    }
  ],
  "included": [
    {
      "type": "contact",
      "id": "100",
      "links": {
        "self": "/?path=/contacts/100"
      },
      "attributes": {
        "phone": "+123456789"
      }
    },
    {
      "type": "contact",
      "id": "101",
      "links": {
        "self": "/?path=/contacts/101"
      },
      "attributes": {
        "email": "john.doe@example.com"
      }
    },
    {
      "type": "contact",
      "id": "102",
      "links": {
        "self": "/?path=/contacts/102"
      },
      "attributes": {
        "email": "secret.doe@example.com"
      }
    }
  ]
}
@kocsismate kocsismate added the bug label May 3, 2016
@kocsismate kocsismate added this to the 0.10.5 milestone May 3, 2016
@kocsismate kocsismate self-assigned this May 3, 2016
@kocsismate
Copy link
Member Author

Fixed in this commit: 1aef043

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant