Azure / Azure/azure-rest-api-specs
[BUG] CognitiveService `ConnectionPropertiesV2` variant models are not exclusively declared
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 444
Description
### API Spec link
https://github.com/Azure/azure-rest-api-specs/blob/a4303ecb6929f5bf7fe6238f93920c4f9950e9b4/specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2026-05-01/cognitiveservices.json
### API Spec version
2026-05-01
### Describe the bug
In the API definition of Cognitive service, there is a *polymorphic* model called `ConnectionPropertiesV2`, which is discriminated by its `authType` attribute, which in turn has about 20 variant enums. However, not all of these variant corresponds to a specific model.
E.g. `ManagedIdentity` variant has the model declared:
```
"ManagedIdentityAuthTypeConnectionProperties": {
"type": "object",
"properties": {
"credentials": {
"$ref": "#/definitions/ConnectionManagedIdentity"
}
},
"allOf": [
{
"$ref": "#/definitions/ConnectionPropertiesV2"
}
],
"x-ms-discriminator-value": "ManagedIdentity"
},
```
While `AccountManagedIdentity` doesn't have such a specialized model.
This is more or less a grey area by implying *if there is no specialized child model, then fallback to the base model for that variant*. However, *this* undocumented behavior is then leaked to all downstream SDKs/applications/any consumer of the API spec, making it hard to do right. Besides, it introduce a discoverability issue for the SDK users about when shall I use which model, which results into a less ideal UX.
### Expected behavior
Supplement the child model declarations to cover all the variant enums.
### Actual behavior
As is described above: some are covered, some are missing.
### Reproduction Steps
N/A
### Environment
_No response_
Contributor guide
Research direction
Start with the linked specification/cognitiveservices.json file and locate the ConnectionPropertiesV2 definition, its authType discriminator values, and the existing specialized child models. Compare every variant with its declared model, add declarations for the uncovered variants, and validate that the API specification remains consistent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100