Skip to content

Conversation

@jasdefer
Copy link

A patch request modifying the relationship threw an error, because the attributes could not be initialized. An additional null check can solve this problem.

@jasdefer
Copy link
Author

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.

@brainwipe
Copy link
Owner

Hi there, thank you for your pull request. Please can you add Unit Tests for your change.

@jasdefer
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants