auth0-authorization-extension icon indicating copy to clipboard operation
auth0-authorization-extension copied to clipboard

Should respond with HTTP status 409 Conflict when request fails because it violates uniqueness constraints

Open andersthorbeck opened this issue 7 years ago • 2 comments

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.

andersthorbeck avatar Jun 12 '18 09:06 andersthorbeck

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.

andersthorbeck avatar Aug 30 '19 07:08 andersthorbeck

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.

andersthorbeck avatar Feb 24 '20 09:02 andersthorbeck