Updating / deleting related resources


#1

Just a few minutes before my weekend started, I figured out that there is a big difference between related resources links and relationship links.

/books/12/author is the related link, that returns the same resource as /authors/12, but /books/12/relationships/author only returns the resource that describes the relationship, so just the pointer to /authors/12…

When I realised this, I started wondering if resources can be created, updated and / or deleted using the related link? The specification doesn’t say anything about it, and somewhere I don’t think it is desirable to do so. Any ideas on this topic?


#2

Why not? Without this feature you would need to make two requests to create a new resource and then link it to an existing resource.


#3

I don’t really remember what I was thinking when I wrote that, but thinking of it now, the only thing I can think of is that for to-many relationships you can get unexpected results… But I am probably over thinking this…