News for hackers. Stuff that matters.
Re:Use links not keys to represent relationships in APIs by mpnally on Monday May 13, 2019 @11:19AM (#19900147)
You don't have to parse entity IDs our of URLs — the URL already is an entity ID, and from the client's perspecitive, it doesn't have any sub-parts that can be parsed out, except those defined in the URI spec (scheme, authority)
Re:Use links not keys to represent relationships in APIs by raquo on Monday May 13, 2019 @12:23PM (#19900845)
That only works if fetching the /people/123 URL is the only thing you will ever do. If you need the real 123 entity id in any other context, e.g. to display it to the user, or to make a user-accessible website link to that entity (e.g. "view this transaction in stripe dashboard"), you'll need parsing.

I also mentioned that I don't want to store redundant garbage in my logs and database, especially if I want to index the column containing that entity id.