Hacker News new | ask | show | jobs
by monkeycantype 3172 days ago
in the article:

/shelf/{something}

{something} could be a name - 'american literature' {something} could be an identifier - '20211fcf-0116-4217-9816-be11a4954344'

if someone calls:

https://library.com/locations: { "kind": "Shelf", "name": "20211fcf-0116-4217-9816-be11a4954344", }

now we have a shelf named with the id of a different shelf

and the meaning of

/shelf/20211fcf-0116-4217-9816-be11a4954344/book

is now ambiguous

i don't know a great way to avoid this

this is unambiguous, but i don't think my co-workers would like it: /shelf/name/{id}/books /shelf/id/{id}/books

I think this would only be slightly more popular

/shelf/name/{id}/books /shelf/{id}/books

because the thing after shelf/ would not consistently be an id