Hello,
as I understand a self
link at any location in a document is basically the link to the same response relative to the documents path.
So if using Sparse Fieldsets I assume that it should be inherited to any self link as well. Not doing so would result in a non matching response if a self link was followed.
Is this correct?
If yes, what links
attribute could be used as a reference to the resource object with full details?
{
"data": [
{
"attributes": {
"name": "First Pool",
"description": "A good pool"
},
"id": "5c071fae-01fa-4f18-b692-7bc6fc98331f",
"links": {
"self": "/pools/5c071fae-01fa-4f18-b692-7bc6fc98331f?fields[pools]=name,description"
},
"type": "pools"
},
{
"attributes": {
"name": "Second Pool",
"description": "Another good pool"
},
"id": "a0d6a8c1-eaed-43ed-8937-f3c5387ee78a",
"links": {
"self": "/pools/a0d6a8c1-eaed-43ed-8937-f3c5387ee78a?fields[pools]=name,description"
},
"type": "pools"
}
],
"links": {
"self": "/pools?fields[pools]=name,description"
}
}
Not including the Sparse Fieldsets in a query might produce other reponses.
{
"data": {
"attributes": {
"name": "First Pool",
"description": "A good pool",
"city": "Berlin",
"country": "Germany",
"active": true
},
"id": "5c071fae-01fa-4f18-b692-7bc6fc98331f",
"links": {
"self": "/pools/5c071fae-01fa-4f18-b692-7bc6fc98331f"
},
"type": "pools",
},
"links": {
"self": "/pools/5c071fae-01fa-4f18-b692-7bc6fc98331f"
}
}