RocketChat / RocketChat/Rocket.Chat
[BUG] REST API endpoint /users does not conform to best practices
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Description:
Currently all actions on "users" with the REST API use unique endpoints.... ex. users.create, users.delete, users.get_avatar, etc.... where the userID is contained in the body. This does not conform to best practices because a GET on the endpoint /users itself should return a collection of users, and the path to perform actions on a specific user should include the "_id"....... ex. /users/{_id} with a GET, DELETE, PUT etc...
A good example of best practice is in the /livechat/departments endpoint, and it would be best if all REST API endpoints used the same design.
We are using terraform to configure users, omnichannel departments, omnichannel agents, etc.... and the users endpoint as is, is not compatible with terraforms 'destroy resource' strategy, and therefore it breaks our automation.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the REST API definitions for /users and the /livechat/departments example mentioned in the issue. Compare their collection and item-route behavior, then trace the Terraform destroy workflow that currently fails. Done means users supports collection access plus /users/{_id} actions consistently with the stated REST design.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100