In the generated magic-module-input files computevirtualmachine, the generated values of go enum variable can contain hyphens or underscores or both. Golang will give warnings about snake cased variable names, so in the generation of Go SDK, hyphens and underscores in enum variables will be removed. For instance, in the generated api.yaml, in the representation of an enum variable
- !ruby/object:Api::Type::Enum
name: 'storageAccountType'
description: 'Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk.'
required: false
sample_value: Standard_LRS
azure_sdk_references: ['/storageProfile/osDisk/managedDisk/storageAccountType', '/properties/storageProfile/osDisk/managedDisk/storageAccountType']
values:
- :Standard_LRS
- :Premium_LRS
- :StandardSSD_LRS
- :UltraSSD_LRS
default_value: :Standard_LRS
All these underscores should be removed. In the definition of vmSize, there are more enum variables contained hyphens and underscores.
- !ruby/object:Api::Type::Enum
name: 'vmSize'
description: 'Specifies the size of the virtual machine. For more information about virtual machine sizes, see [Sizes for virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). <br><br> The available VM sizes depend on region and availability set. For a list of available sizes use these APIs: <br><br> [List all available virtual machine sizes in an availability set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) <br><br> [List all available virtual machine sizes in a region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) <br><br> [List all available virtual machine sizes for resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes)'
required: false
sample_value: Standard_D2_v2
azure_sdk_references: ['/hardwareProfile/vmSize', '/properties/hardwareProfile/vmSize']
values:
I am generating
api.yaml
file usingautorest.cli
with input file:azure-rest-api-specs\specification\compute\resource-manager\readme.md
Tag in use
package-2019-07
.Cli section added in
readme.md
Problem encountered
In the generated
magic-module-input
filescomputevirtualmachine
, the generated values of go enum variable can contain hyphens or underscores or both. Golang will give warnings about snake cased variable names, so in the generation of Go SDK, hyphens and underscores in enum variables will be removed. For instance, in the generatedapi.yaml
, in the representation of an enum variableAll these underscores should be removed. In the definition of
vmSize
, there are more enum variables contained hyphens and underscores.