Azure / Azure/azure-rest-api-specs
[BUG] Storage networkACLs bypass is defined as an enum but doesn't really meet the criteria for being an enum
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 3d 37m
- Merged PRs (30d)
- 446
Description
### API Spec link
https://github.com/Azure/azure-rest-api-specs/blob/main/specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/storage.json#L2999
### API Spec version
2024-01-01
### Describe the bug
The `bypass` field says:
```
"bypass": {
"type": "string",
"enum": [
"None",
"Logging",
"Metrics",
"AzureServices"
],
"x-ms-enum": {
"name": "Bypass",
"modelAsString": true
},
"x-ms-client-name": "Bypass",
"default": "AzureServices",
"description": "Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, \"Logging, Metrics\"), or None to bypass none of those traffics."
},
```
This is described as an enum field, but it's not providing Enum semantics as you can combine the enum values into a combination string like `Logging, Metrics`. It's `modelAsString: true` so users can always put whatever they want, but it's different than 99% of Azure enums and is surprising to users.
### Expected behavior
The `bypass` field is either modelled as a JSON array of enums (cleaner but breaking), or maybe the `enum`-ness of this field is just dropped.
### Actual behavior
n/a
### Reproduction Steps
n/a
### Environment
_No response_
Contributor guide
Research direction
Start at specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/storage.json around the networkACLs bypass field and compare its schema with similar Azure enum definitions. Resolve whether the field should represent combinations as an array or stop using enum semantics, then validate that the resulting API specification matches the intended compatibility behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi
- Domain
- api, backend-api-design
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100