Fixed updating relationships, when no attributes are specified.
A patch request modifying the relationship threw an error, because the attributes could not be initialized. An additional null check can solve this problem.
I am very unfamiliar with the flow on GitHub and this is my first pull request ever. Don't hesitate and point out my mistakes.
Hi there, thank you for your pull request. Please can you add Unit Tests for your change.
Okay, I just looked at some tests and the WithResult(new ObjectResult(post)) method on the FilterContextBuilder seems to be creating the content for the requests. I am not sure how to create a Patch request like this:
PATCH /posts/1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
{
"data": {
"type": "post",
"id": "1",
"relationships": {
"author": {
"data": {"type": "people", "id": "2"}
}
}
}
}
This request should be able to update the relationship of a post