3 ms·
As described in https://cloud.google.com/apis/design/design_patterns#get_unique_resource_from_sub-collection https://cloud.google.com/apis/design/design_pattern
by absalyamov 10y ago
As described in https://cloud.google.com/apis/design/design_patterns#get_unique_resource_from_sub-collection https://cloud.google.com/apis/design/design_patterns#get_uni...:
//calendar.googleapis.com/users/-/events/123
- theptip 10y agoHadn'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).
- the8bit 10y agoWhile 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.
- theptip 10y agoAgree; put another way, sometimes you really do need a M2M relationship.