Hi there!
I’m trying to understand how to use relationships and stuck with it.
For example, I have a group
resource which contains users:
GET /groups/123
{
"data": {"type": "group", "id": "123"},
"relationships": {
"users": {
"data": [
{"type": "users", "id": "1"},
{"type": "users", "id": "2"},
],
"links": {
"self": "/groups/123/relationships/users",
"related": "/groups/123/users"
}
}
}
}
Then I fetch related
link and get list of users in the group.
GET /groups/123/users
{
"data": [
{"type": "users", "id": "1"},
{"type": "users", "id": "2"}
],
"relationships": {
"group": {
"data": {"type": "groups", "id": "123"},
"links": {
"self": "?",
"related": "/"
}
}
}
}
Is it ok to use "/"
as related
link and how self
should looks like in this case? Or I shouldn’t use member links
in the list of users at all?