Hi,
I have an API with the following urls:
/session
/session/account
/session/account/profile
I was wondering if it is ok to include both /session/account
and /session/account/profile
as relationships
of the /session
, like this:
// GET `/session` response
{
"links": {
"self": "https://example.com/session"
},
"data": {
"id": "sessionid123",
"type": "session"
"relationships": {
"account": {
"links": {
"related": "https://example.com/session/account"
},
"data": {
"id": "abc1234",
"type": "account"
}
},
"profile": {
"links": {
"related": "https://example.com/session/account/profile"
},
"data": {
"id": "profileid",
"type": "accountProfile"
}
}
}
}
}
or if the /session/account/profile
relationship is only a relationship of /session/account
(that is, it should be in the relationships
field only when requesting /session/account
).
Thanks!