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

Search for relationships inside the data object. #51

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

2inqui
Copy link

@2inqui 2inqui commented Jun 12, 2017

When having relationships to the same content_type which are included in data attribute the parsing is now linking them.

2inqui added 2 commits June 6, 2017 13:43
same type of resources.

For example having a response like:
```
{
  "data": [
    {
      "id": "29",
      "type": "ediary_entry_groups",
      "attributes": {
        "name": "Record Fasting",
        "permanent_link": "fasting",
        "position": 2,
        "category": null,
        "created_at": "2017-06-02T20:06:16Z",
        "updated_at": "2017-06-02T20:06:16Z"
      },
      "relationships": {
        "ediary_entries": {
          "data": []
        },
        "entry_templates": {
          "data": []
        },
        "child_entry_groups": {
          "data": [
            {
              "id": "30",
              "type": "ediary_entry_groups"
            },
            {
              "id": "31",
              "type": "ediary_entry_groups"
            },
            {
              "id": "32",
              "type": "ediary_entry_groups"
            },
            {
              "id": "33",
              "type": "ediary_entry_groups"
            }
          ]
        },
        "parent_entry_group": {
          "data": null
        }
      }
    },
...
```

The relationships are not being mapped because they are inside data, not
included as we expect.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant