[Breaking Change] Rule "AddedXmsEnum" treats "string" and "open enum" as incompatible
- Dominant language
- C#
- Stars
- 135
- Forks
- 260
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 115
Description
Given the following types:
```
// string
"type": "string"
// closed enum
"type": "string",
"x-ms-enum": { "modelAsString": false },
"enum": [ "westus", "westeurope"]
// open enum
"type": "string",
"x-ms-enum": { "modelAsString": true },
"enum": [ "westus", "westeurope"]
```
Types "string" and "open enum" should be considered fully compatible, since "open enum" is just documenting the valid values and saying that the set is open. "closed enum" should be considered incompatible with both "string" and "open enum", since the valid values are closed.
In https://github.com/Azure/azure-rest-api-specs/pull/26658, check "Swagger BreakingChange" seems to get this wrong in rule and `1048 - AddedXmsEnum`.

```
// from
"type": "string",
"description": "The type discriminator describing a sub-type of QueueSelectorAttachment"
// to
"type": "string",
"description": "Supported queue selector attachment types",
"enum": [ "conditional", ... ],
"x-ms-enum": { "modelAsString": true ... }
```
Contributor guide
Assessment
This issue has not been assessed yet.