Azure / Azure/azure-rest-api-specs
[BUG][Bot Service] deploymentEnvironment's default value causes internal server error when try to create ms teams channel
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 424
Description
### API Spec link
https://github.com/Azure/azure-rest-api-specs/blob/main/specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/botservice.json#L2259
### API Spec version
2022-09-15
### Describe the bug
As defined in swagger, MsTeamsChannel has property `deploymentEnvironment` with default value `FallbackDeploymentEnvironment`.

Yet, when passing this value to create MsTeamsChannel, would receive the error from service and fail to create the channel:
```
azure.core.exceptions.HttpResponseError: (UnknownError) An unexpected error occurred. Exception: 'Newtonsoft.Json.JsonSerializationException: Error converting value "FallbackDeploymentEnvironment" to type 'Microsoft.Bot.Internal.Schema.FirstPartyChannelDeploymentEnvironment'. Path 'properties.deploymentEnvironment'. ---> System.ArgumentException: Requested value 'FallbackDeploymentEnvironment' was not found.
```
### Expected behavior
Update the swagger file to have a workable default value for property `deploymentEnvironment`.
### Actual behavior
Now we have to remove `deploymentEnvironment` from the request body to make the operation succeed.
### Reproduction Steps
Send request body with default values that defined in swagger, receive internal server error.
```
{"location": "global", "properties": {"channelName": "MsTeamsChannel", "location": "global", "properties": {"enableCalling": false, "isEnabled": true, "deploymentEnvironment": "FallbackDeploymentEnvironment"}}}
```
### Environment
_No response_
Contributor guide
Research direction
Open specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/botservice.json around line 2259 and inspect MsTeamsChannel.properties.deploymentEnvironment. Compare the declared default with the service's accepted values, then verify the corrected default using the reproduction request; done means creating the MS Teams channel no longer returns the conversion error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100