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

Removing a to one relationship using PATCH as to the spec errors out #404

Open
PieterJanVdb opened this issue May 3, 2018 · 0 comments
Open

Comments

@PieterJanVdb
Copy link

Removing a relationship using PATCH as the spec defines here returns the following error:

"errors": [
  {
    "status": "403",
    "code": "EFORBIDDEN",
    "title": "Request validation failed",
    "detail": "Missing \"data\" - have you sent the right http headers?"
  }
]

This happens because for this route, it checks if the data property of the body is either an object or an array, and errors out otherwise.

However the spec specifies that you can unset a relationship by setting data to null like so:

PATCH /articles/1/relationships/author HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json

{
  "data": null
}

Is this something that warrants a PR or will no route accept null as the value of data as a rule?

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

No branches or pull requests

1 participant