Time  Nick     Message
11:11 sz332    morning guys
11:11 sz332    question about REST path development (just because so many clever guys are here) how would you solve the following: we have users. To users we can assign or deassign cats from a predefined list. We would also know which cats are assigned, and which are not. How would a preferred rest api path look like? GET /users/{id}/cats/current, GET /users/{id}/cats/available, POST /users/{id}/cats/assign, POST /users/{id}/cats/deassign
11:16 trygvis  the paths are never important
11:50 sz332    trygvis: my question is whether this is a good design, or not?
11:51 sz332    trygvis: i have seen stuff like /action/active /action/deactivate
11:51 spaceone I wouldn't like to "POST assign" but to PUT .../cats" with <categories>...</categories> as payload
11:52 trygvis  sz332: URL design is not a part of REST, it really does not matter what you do
11:52 trygvis  do whatever is easiest to consume and implement
11:53 sz332    spaceone: and how would you tell the server that the action is an assignment, or deassignment? (think about those left-right assign-deassign panels on client side)
11:53 spaceone sz332: by providing the full representation of the new state
11:53 spaceone the server can diff with the current state then
11:53 sz332    spaceone: ah, okay, that makes sense
11:53 spaceone and knows where to assign and where to deassign
11:54 sz332    spaceone: actually, it is quite nice approach
11:54 spaceone :)
11:55 sz332    spaceone: so this means GET /users/{id}/cats returns the assigned cats, PUT /users/{id}/cats assigns the cats, and GET /users/{id}/cats/available returns the cats which are not associated?
11:55 spaceone yes, that is the way HTTP was meant to be used
11:57 sz332    okay, thank you very much
11:57 spaceone and you could also do thing like POST /users/{id}/cats to add one. or DELETE /users/{id}/cats/foo to remove one