Azure / Azure/azure-rest-api-specs

[BUG] Inconsistency response content between actual call and swagger definition in OperationalInsights

Open
#27,057 1 comment 0 reactions 0 assignees View on GitHub
Operational Insights Service Attention
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
2d 22h
Merged PRs (30d)
444

Description

### Library name and version
operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/StorageInsightConfigs.json

### Describe the bug
The [request](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/StorageInsightConfigs.json#L68) and [response](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/StorageInsightConfigs.json#L89) received in the path `"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}"` PUT are defined using the same parameters and the parameter `key` here must be [not-null](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/StorageInsightConfigs.json#L231)

Actual success PUT request and it's 200 response: **The 200 response received does not have the `key` parameter, causing an exception to be thrown.**
```
{"tags":{"key1":"value"},"properties":{"containers":["dsad"],"storageAccount":{"id":"/subscriptions//resourceGroups//providers/Microsoft.Storage/storageAccounts/","key":""}}}
```
```
HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 558
Content-Type: application/json; charset=utf-8
Expires: -1
x-ms-ratelimit-remaining-subscription-writes: 1196
Access-Control-Allow-Origin: *
Request-Context: appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508
X-Content-Type-Options: nosniff
api-supported-versions: 2015-03-20, 2020-08-01
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Powered-By: ASP.NET
x-ms-request-id: 1e6cc487-cf0f-480c-907c-91ec31acc9a3
x-ms-correlation-request-id: 1e6cc487-cf0f-480c-907c-91ec31acc9a3
x-ms-routing-request-id: SOUTHEASTASIA:20231212T070439Z:1e6cc487-cf0f-480c-907c-91ec31acc9a3
Date: Tue, 12 Dec 2023 07:04:38 GMT

{"properties":{"containers":["dsad"],"storageAccount":{"id":"/subscriptions//resourceGroups//providers/Microsoft.Storage/storageAccounts/"},"status":{"state":"OK"}},"location":"eastus","tags":{"key1":"value"},"id":"/subscriptions//resourceGroups/StorageInsight-test/providers/Microsoft.OperationalInsights/workspaces/InWorkspace/storageinsightconfigs/","name":"OpStInsight","type":"Microsoft.OperationalInsights/workspaces/storageinsightconfigs"}
```
### Expected behavior
Create the StorageInsightResource success.
### Actual behavior
A ArgumentNullException is thrown.
### Environment
No response

Contributor guide

Open the contributing guide

Research direction

Start with operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/StorageInsightConfigs.json, especially the PUT request and response definitions around the referenced lines. Compare their schema with the documented successful 200 response and verify that a response without properties.storageAccount.key no longer causes the reported ArgumentNullException.

Written by the indexing model from the issue text.

Assessment

Tech stack
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
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.