News for hackers. Stuff that matters.
Re:Ask HN: Nested Resources in REST/HTTP API URLs? by Brystephor on Friday August 19, 2022 @01:14AM (#32517732)
The data model matters doesn't it?

If it's /org/orgId/blog/blogId and a user has access to only a single orgId and needs to be logged in then doing it in /blog/blogId makes sense.

But if a user has acess to multiple orgs via different orgIds, then it makes more sense to do the former with /org/orgId/blog/blogId because then the page is sharable via URL. If you do just /blog/blogId that prevents a user from easily accessing a new organization (unless you use query parameters)

Re:Ask HN: Nested Resources in REST/HTTP API URLs? by mtrpcic on Friday August 19, 2022 @01:35AM (#32517800)
Just gives blogs unique IDs regardless of the organization. No two blogs ever have the same ID. Now the route doesn't need to provide the Organization ID, because that association lives in the data store for your application and you can infer it.