Skip to content

Changing type, id with PATCH? #481

@ethanresnick

Description

@ethanresnick

Right now, the spec says that PATCHing a resource requires providing a (type, id) pair in the request's primary resource object. It doesn't say, though, whether those values could differ from the resource's existing (type, id).

For example, imagine that you have resources of types teachers and administrators, and a request to GET /people returns a collection with resources of both types. Now, if GET /people/1 returns a teachers resource, it might be useful to be able to change the resource's type like so:

PATCH /people/1

{
  "data": {
    "type": "administrators",
    "id": "1"
  }
}

Should this behavior be allowed? And what about changing the id of an existing resource (which I find harder to justify)?

I'm not sure if this needs to be clarified pre-1.0 or if it's ok for the spec to leave this undefined, but I wanted to at least open an issue for it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions