Title: If you&#x27;re building a REST&#x2F;HTTP API, how do you think about when to express the hierarchy of resources in the URLs?<p>For example, let&#x27;s say you had a blog site. Organizations have blogs. Blogs are made up of sections and comment threads. Comment threads have individual comments.<p>Would you opt for:<p>- &#x2F;organizations&#x2F;:organizationId&#x2F;blogs&#x2F;:blogId OR &#x2F;blogs&#x2F;:blogId (and get the organization from somewhere else like an auth token)<p>- &#x2F;organizations&#x2F;:organizationId&#x2F;blogs&#x2F;:blogId&#x2F;sections&#x2F;:sectionId OR &#x2F;blogs&#x2F;:blogId&#x2F;sections&#x2F;:sectionId OR &#x2F;sections&#x2F;:sectionId<p>- &#x2F;organizations&#x2F;:organizationId&#x2F;blogs&#x2F;:blogId&#x2F;threads&#x2F;:threadId&#x2F;comments&#x2F;:commentId... you get the idea
Upvote: