Closed
Description
As the title says, really. For example:
GET /employees/
{
"data": {
"type": "employees",
"id": "<id>",
"attributes": {
"first-name": "Scott",
"last-name": "Jones",
"full-name": "Scott Jones",
},
"relationships": {
"permissions": {
"data": []
}
},
"links": {
"self": "https://api.dev/employees/<id>"
}
}
}
PATCH /employees/
Request:
{
"data": {
"type": "employees",
"id": "<id>",
"attributes": {
"first-name": "Jim",
"last-name": "Brown"
},
"relationships": {
"permissions": {
"data": [
{ "type": "permissions", "id": "practicegroup-employees" },
{ "type": "permissions", "id": "practicegroup-practices" }
]
}
}
}
}
Response:
{
"data": {
"type": "employees",
"id": "<id>",
"attributes": {
"first-name": "Jim",
"last-name": "Brown",
"full-name": "Jim Brown",
},
"relationships": {
"permissions": {
"data": []
}
},
"links": {
"self": "https://api.dev/employees/<id>"
}
}
}
GET /employees/
{
"data": {
"type": "employees",
"id": "<id>",
"attributes": {
"first-name": "Jim",
"last-name": "Brown",
"full-name": "Jim Brown",
},
"relationships": {
"permissions": {
"data": [
{ "type": "permissions", "id": "practicegroup-employees" },
{ "type": "permissions", "id": "practicegroup-practices" }
]
}
},
"links": {
"self": "https://api.dev/employees/<id>"
}
}
}
Why do the attributes come through updated, but the relationships do not?