Azure / Azure/azure-rest-api-specs

DELETE Microsoft.Authorization/roleAssignments may also return HTTP code 204

Open
#11,829 3 comments 0 reactions 0 assignees View on GitHub
Authorization Service Attention
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
2d 22h
Merged PRs (30d)
444

Description

**Issue:** According to [Microsoft-internal telemetry](https://microsoft-my.sharepoint-df.com/:t:/p/pevezzac/ESMDfu51bOpKtMGui7r-2DUBO5lQ7pb6YyZSLW3kQXvNDA?e=dTgjqL), a `DELETE` operation for the `Microsoft.Authorization/roleAssignments` endpoint may also return HTTP code 204. This may returned when the same `DELETE` operation is triggered in a quick succession.

Currently all API versions for the `Microsoft.Authorization` provider list only HTTP code 200 as a valid success return code:

* [2015-07-01](https://github.com/Azure/azure-rest-api-specs/blob/bd9c2010c4165f1e792d6fec1e40c5fde49d063e/specification/authorization/resource-manager/Microsoft.Authorization/stable/2015-07-01/authorization-RoleAssignmentsCalls.json#L190-L197)
* ...
* [2020-04-01-preview](https://github.com/Azure/azure-rest-api-specs/blob/bd9c2010c4165f1e792d6fec1e40c5fde49d063e/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-04-01-preview/authorization-RoleAssignmentsCalls.json#L178-L185)

This causes downstream problems as AutoRest clients depend on the API spec to parse the return code and will throw an exception when facing unexpected HTTP codes such as 204 e.g. https://github.com/Azure/azure-libraries-for-net/issues/1139

**Expected:** Either add a new REST API spec for the `Microsoft.Authorization` provider or edit the existing ones including HTTP 204 as a valid return code.

Contributor guide

Open the contributing guide

Research direction

Start with specification/authorization/resource-manager/Microsoft.Authorization/stable/2015-07-01/authorization-RoleAssignmentsCalls.json and the preview/2020-04-01-preview equivalent linked in the issue, then inspect the other Microsoft.Authorization API versions. Confirm how DELETE roleAssignments responses are declared and update the relevant specifications so HTTP 204 is accepted alongside 200; done means the affected versions consistently describe both success codes.

Written by the indexing model from the issue text.

Assessment

Tech stack
json, openapi
Domain
api, backend-api-design
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.