-
Notifications
You must be signed in to change notification settings - Fork 82
REST API ref: Merge /user/groups/{id}/ into /user/groups/{path}/ #1843
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
5daa16c to
6df9608
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The controller is extracting the ID from the path argument by splitting this path on slashes and keeping the last item ( extractLocationIdFromPath). So, it works with just the ID.
The description is not wrong but doesn't cover the whole possibilities. If having only a path, a developer shouldn't extract the ID from this path before use but directly use this path. Anyway, just having access to the path seems like a rare case to me, and an ID simpler to use.
This is a more general problem than just below /user/groups/{path}/;
Other routes having a {path} argument are in fact extracting the ID from it with their documentation not saying it.
From my PoV, the worst could be /content/locations/{path} description only documenting the path while its controller will extract the ID from this path. The 3 following example are equivalent but only the complex one is proposed:
/content/locations/1/2/61(full path)/content/locations/2/61(incomplete path)/content/locations/61(ID)
I propose to not edit this description in this PR.
6df9608 to
72aaa84
Compare
|
We shouldn't really encourage using "path" as the last argument, even if it works this way. Instead we should always declare that we expect an ID there. |
@Steveb-p I'm agree. So we could merge route entries the reverse way, both under /user/groups/{id}/ instead. |
* ez-user-groups.raml: Merge /{id}/users into /{path}/users
* ez-user-groups.raml: Merge /{id}/subgroups into /{path}/subgroups
(cherry picked from commit d211e4a)
3.3 (ezsystems/ezplatform-rest 1.3), 2.5 (ezsystems/ezpublish-kernel 7.5)
/user/groups/{id}/usersinto/user/groups/{path}/users:GETandPOSTof the same route were separated, both respective controller actions (loadUsersFromGroupandcreateUser) treat the argument as a path, and extract an ID from it./user/groups/{id}/subgroupsinto/user/groups/{path}/subgroups:GETandPOSTof the same route,loadSubUserGroupsandcreateUserGrouptreat the argument as a path.TODO
Checklist