Re:API Design Guide
by absalyamov on Wednesday February 22, 2017 @11:27PM
(#13711626)
As described in https://cloud.google.com/apis/design/design_patterns#get_uni...:
[ Parent
| on HN ]
Hadn't spotted that, it's an interesting syntax and I quite like it.
But it doesn't cover the case I'm referring to; in their example you MUST return the fully-qualified URL:
> shelves/shelf713/books/book8141, not shelves/-/books/book8141
This precludes there being multiple shelves with the same book (sensible in their example, since a book has only one shelf, but not in the example above).
While sometimes this does get tricky with resources that are clearly owned or associated with multiple things, often times a resource only has one real owner and it is unambiguous. It does make moving things a bit weird though, as moving a book between two shelves makes it have a different fully qualified name.