Azure / Azure/azure-rest-api-specs

Security.AssessmentMetadata API always returns `Unknown` when `categories` isn't specified in the request body

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

Description

After tested, seems Security.AssessmentMetadata API always returns `Unknown` when [`categories`](https://github.com/Azure/azure-rest-api-specs/blob/c059fb47f87a35ce5a90631883dfba8f01a41d8e/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/assessmentMetadata.json#L317) isn't specified in the request body. But “Unknown” isn't in the category list. So it doesn't make sense. After synced with service team, they confirmed will add `Unknown` as possible value to this property and it will be published as a new version of this API.

Http request body:
```
PUT https://management.azure.com/subscriptions/xx-xx-xx-xx/providers/Microsoft.Security/assessmentMetadata/xxx-xxx-xxx-xxx?api-version=2020-01-01

{
"properties": {
"displayName": "xxx-xxx-xxx-xxx",
"description": "Test description",
"severity": "Medium",
"assessmentType": "CustomerManaged",
}
}
```

Http response:
```
{
"id": "/subscriptions/xxx-xxx-xxx-xxx/providers/Microsoft.Security/assessmentMetadata/xxx-xxx-xxxx-xxx",
"name": "xxx-xxxx-xxxx-xxxx",
"type": "Microsoft.Security/assessmentMetadata",
"properties": {
"displayName": "xxx-xxxx-xxxx-xxxx",
"assessmentType": "CustomerManaged",
"description": "Test Description",
"categories": [
"Unknown"
],
"severity": "Medium"
}
}
```

Contributor guide

Open the contributing guide

Research direction

Start with specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/assessmentMetadata.json, especially the categories definition linked in the issue. Compare the declared category values with the documented response behavior and the service team's stated API-version update. Done means the specification accurately represents Unknown for responses when categories is omitted, with validation passing.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.