Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed updating relationships, when no attributes are specified. #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

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