Azure / Azure/azure-rest-api-specs
MachineLearningService Workspaces_CreateOrUpdate returns 202 but the `responses` field only defines status code `200` and `201` as succeed
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 424
Description
The `responds` now reads:
```
"responses": {
"200": {
"description": "The request was successful; the request was well-formed and received properly.",
"schema": {
"$ref": "#/definitions/Workspace"
}
},
"201": {
"description": "The request was successful; the request was well-formed and received properly.",
"schema": {
"$ref": "#/definitions/Workspace"
}
},
"default": {
"description": "Error response describing why the operation failed",
"schema": {
"$ref": "#/definitions/MachineLearningServiceError"
}
}
}
},
```
But the call of rest api returns status code `202` as following:

This will be handled as failure in generated SDK since this status code is not among the expected ones. For instance, in go SDK:
```
machinelearningservices.WorkspacesClient#CreateOrUpdate: Failure responding to request: StatusCode=202 -- Original Error: autorest/azure: error response cannot be parsed: "" error: EOF
```
Contributor guide
Research direction
Locate the MachineLearningService Workspaces_CreateOrUpdate API definition and inspect its declared success responses against the reported REST response. Confirm that the generated Go SDK no longer treats status code 202 as a failure, and verify the response definitions match the service behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, openapi
- Domain
- api, backend-api-design
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 34/100