Azure / Azure/azure-rest-api-specs

[BUG][Bot Service] deploymentEnvironment's default value causes internal server error when try to create ms teams channel

Open
#28,636 2 comments 0 reactions 0 assignees View on GitHub
Bot Service bug Mgmt Service Attention
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`.
![image](https://github.com/Azure/azure-rest-api-specs/assets/119990644/03b7ff72-8f59-4a5a-afc0-f9f246b84af8)
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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.