-
Notifications
You must be signed in to change notification settings - Fork 925
Changing type, id with PATCH? #481
Description
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.