Azure / Azure/azure-rest-api-specs
Microsoft.Network/virtualnetworkgateways@2022-01-01 the name of field `"type"` is the same
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 444
Description
### **Description**
In `"NatRule"`, field `"type"` appears twice. On the cli, only one of the two `"type"` can be selected for output. Hoping to solve the problem of two duplicate names so that both `"type"` can be displayed completely.
### **API flow:**
https://github.com/Azure/azure-rest-api-specs/blob/main/specification/network/resource-manager/Microsoft.Network/stable/2022-01-01/virtualNetworkGateway.json
"VirtualNetworkGatewayNatRule": {
"properties": {
"properties": {
"x-ms-client-flatten": true,
"$ref": "#/definitions/VirtualNetworkGatewayNatRuleProperties",
"description": "Properties of the Virtual Network Gateway NAT rule."
},
"name": {
"type": "string",
"description": "The name of the resource that is unique within a resource group. This name can be used to access the resource."
},
"etag": {
"type": "string",
"readOnly": true,
"description": "A unique read-only string that changes whenever the resource is updated."
},
**"type": {
"readOnly": true,
"type": "string",
"description": "Resource type."
}**
},
"allOf": [
{
"$ref": "./network.json#/definitions/SubResource"
}
],
"description": "VirtualNetworkGatewayNatRule Resource."
},
"VirtualNetworkGatewayNatRuleProperties": {
"properties": {
"provisioningState": {
"readOnly": true,
"$ref": "./network.json#/definitions/ProvisioningState",
"description": "The provisioning state of the NAT Rule resource."
},
**"type": {
"type": "string",
"description": "The type of NAT rule for VPN NAT.",
"enum": [
"Static",
"Dynamic"
],**
"x-ms-enum": {
"name": "VpnNatRuleType",
"modelAsString": true
}
},
Contributor guide
Research direction
Start with specification/network/resource-manager/Microsoft.Network/stable/2022-01-01/virtualNetworkGateway.json and inspect the VirtualNetworkGatewayNatRule and VirtualNetworkGatewayNatRuleProperties definitions. Reproduce the CLI output for the NAT rule, then determine how the duplicate type fields are represented and verify that both values can be displayed without breaking the API specification.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, openapi
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100