Azure / Azure/azure-rest-api-specs

Security RP swagger correctness issue and API version issue result to SDK issue

Open
#20,166 1 comment 0 reactions 0 assignees View on GitHub
Security Service Attention
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
3d 2h
Merged PRs (30d)
424

Description

- As the SDK is generated from api version 2017-08-01-preview which is configured from https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager#tag-package-composite-v3

And some of the properties we see when using Azure CLI of api version 2020-01-01-preview has not been added in api version 2017-08-01-preview yet. for example notificationsByRole

- Both in api version 2017-08-01-preview and api version 2020-01-01-preview, there's a x-ms-client-flatten https://github.com/Azure/azure-rest-api-specs/blob/main/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/securityContacts.json#L267 set here, which tells the client side to put all the properties under properties to be the direct property of top level, for example alertNotifications should be a property of properties but now it's a property of root directly. that's why we don't see properties in the SDK response.
- There's a response structure change compared between api version 2017-08-01-preview and 2020-01-01-preview which cause even if we generate the SDK from 2020-01-01-preview now, we still can't get the result of securityContacts.list() to resolve this issue.
here's the raw response structure of 2017-08-01-preview version
{
"value": [
{
"etag": "",
"id": "",
"location": "West Europe",
"name": "default",
"properties": {
....
},
"type": "Microsoft.Security/securityContacts"
}
]
}
here's the raw response structure of 2020-01-01-preview version

[
{
"etag": "",
"id": "",
"location": "West Europe",
"name": "default",
"properties": {
.....
},
"type": "Microsoft.Security/securityContacts"
}
]
which contradict with their swagger definition of SecurityContactList response type here https://github.com/Azure/azure-rest-api-specs/blob/main/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/securityContacts.json#L200-L217
we will need to ask service team to fix that in service returned response.

Routed from https://github.com/Azure/azure-sdk-for-js/issues/22351

Contributor guide

Open the contributing guide

Research direction

Compare Microsoft.Security/preview/2017-08-01-preview/securityContacts.json with the 2020-01-01-preview definition, focusing on the x-ms-client-flatten setting and SecurityContactList response shape. Review the raw response examples against the swagger definitions, then determine the required spec or service-team follow-up so securityContacts.list() returns the documented structure and properties.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi
Domain
api, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.