Skip to content

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

Description

@PieterJanVdb

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions