I have done some research:
From here: Usage of `related` field in Relationships link - #8 by ethanresnick
So, in real word example ( from my previous post ) i believe it should like something like this:
GET /v1/module/countries
{
"links": {
"self": "https://example.com/v1/module/countries"
},
"data": {
"id": "county_id",
"type": "countries",
"relationships": {
"state": {
"links": {
"related": "https://example.com/countries/county_id/states" // states is plural, it's ok?
},
"data": {"id": "state_id", "type": "state"}
}
}
},
"included": [{
"id": "state_id",
"type": "state",
"attributes": {
},
"relationships": {
"cities": {
"links": {
"related": "https://example.com/state/state_id/cities" // cities is plural, it's ok?
},
"data": {
"id": "cities", // what about cities id
"type": "accountProfile"
}
}
}]
}
}
According this resource: Is it ok to add multiple levels of nested relationships in the relationships field - #2 by ethanresnick
But still i feel like missing something and confused about all these relationships and i don’t see any logical reasoning and connections between this complexity.