Azure / Azure/azure-rest-api-specs

[BUG] Discriminated set models contain same value on discriminator values in MFE

Open
#29,320 0 comments 0 reactions 0 assignees View on GitHub
bug
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/67e8e173b7a52626d07b4bd4001abcb5bd413b34/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/mfe.json

### API Spec version

2023-06-01-preview

### Describe the bug

We have a base model with discriminator: [DataVersionBase](https://github.com/Azure/azure-rest-api-specs/blob/67e8e173b7a52626d07b4bd4001abcb5bd413b34/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/mfe.json#L14708), which defines the property `datatype` as its discriminator, which is fine.
It has four derived models, but these two: [UriFolderDataVersion](https://github.com/Azure/azure-rest-api-specs/blob/67e8e173b7a52626d07b4bd4001abcb5bd413b34/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/mfe.json#L26081) and [DataImport](https://github.com/Azure/azure-rest-api-specs/blob/67e8e173b7a52626d07b4bd4001abcb5bd413b34/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2023-06-01-preview/mfe.json#L14522) have the same discriminator value `uri_folder`, which is impossible.
Telling from their names, the latter one “DataImport” probably has the wrong discriminator value.
This leads to the result that in our generated SDKs, this model only have 3 variants: https://github.com/Azure/azure-sdk-for-net/blob/23b9d78468744022981a7ec1d44537412ef715b8/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDataVersionProperties.Serialization.cs#L166

### Expected behavior

Every variant in a discriminated set should have unique discriminator values

### Actual behavior

2 of them have the same value.

### Reproduction Steps

Just check the swagger.

### Environment

Irrelevant

Contributor guide

Open the contributing guide

Research direction

Open the referenced mfe.json specification and compare the discriminator definitions for DataVersionBase, UriFolderDataVersion, and DataImport. Determine the intended distinct value for DataImport, update the specification, and validate that every derived model has a unique discriminator value.

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
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.