Azure / Azure/azure-rest-api-specs

MachineLearningService Workspaces_CreateOrUpdate returns 202 but the `responses` field only defines status code `200` and `201` as succeed

Open
#8,029 1 comment 0 reactions 0 assignees View on GitHub
ADO Machine Learning Mgmt ML-Workspace Management question Service Attention
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:
![Screen shot of the rest api response](https://user-images.githubusercontent.com/10554446/71433846-73960300-271c-11ea-88b2-32e98a92fbe7.png)
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.