News for hackers. Stuff that matters.
Re:Rules for REST API URI Design by iamphilrae on Sunday June 18, 2017 @06:08AM (#14579928)
I just had this exact 'problem' with an API I'm building. I just ended up creating both routes which accessed the same internal function to return the same results - no duplication of code necessary. Personally I think this is a good resolve as it answers both use cases depending on the accesssors context.
Re:Rules for REST API URI Design by iamphilrae on Sunday June 18, 2017 @06:12AM (#14579941)
To add, my endpoints were:

/accounts/{id}/users

And

/users/account/{id}

Both return the users attached to a particular account.