Should respond with HTTP status 409 Conflict when request fails because it violates uniqueness constraints
Under different circumstances, both creating and updating a group has failed for me with HTTP status 400. It took me a little while to figure out that in both cases, the underlying issue was that the group's intended new name was already in use by another group.
In such situations, wouldn't it make more sense to respond with HTTP status 409 Conflict instead of the very generic 400 Bad Request? 400 Bad Request could mean anything, even that your request can't be parsed. 409 Conflict is much more specific and helpful, in my opinion.
This issue has occurred again, where time was wasted debugging what was wrong with the format of our request, after we received a 400 Bad Request instead of a 409 Conflict when we attempted to create a group whose name already was in use by an existing group.
This issue persists. It would be very useful if the response statuscode for this case could be 409 Conflict, so that we can more easily identify this problem and handle it accordingly.