Open HuShaoRu opened 1 month ago
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @amjads1 @avirishuv @Drewm3 @vaibhav-agar.
Looks this is a SDK issue, remove the 'service attention' label for now.
Hi @HuShaoRu,armcompute sdk UnmarshalJSON parses keys starting with lowercase characters by default:https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/resourcemanager/compute/armcompute/models_serde.go#L10582
swagger defineitions(lower case): https://github.com/Azure/azure-rest-api-specs/blob/main/specification/compute/resource-manager/Microsoft.Compute/Skus/stable/2021-07-01/skus.json#L164
type Details armcompute.ResourceSKUZoneDetails
var dd Details // wrapped track2, so it won't use defined UnmarshalJSON
The method you mentioned above does not inherit the UnmarshalJSON functions of armcompute.ResourceSKUZoneDetails, so it can Unmarshal to Name
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @amjads1 @avirishuv @Drewm3 @vaibhav-agar.
@HuShaoRu We are aware of these capitalization inconsistencies and are working to resolve them via a larger project.
Bug Report
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6
master
go version
:go version go1.22.5 linux/amd64
When I used
ResourceSKUsClient
to get the list of Microsoft.Compute SKUs, I found I couldn't get sku.LocationInfo[].ZoneDetails[].Name (always empty).I find, the api returns
Name
inzoneDetails
, however, the sdk only matchesname
(seefunc (r *ResourceSKUZoneDetails) UnmarshalJSON
in models_serde.goIt might be an error from resource provider, but at least the sdk can't work now.
sku.LocationInfo[].ZoneDetails[].Name should not be empty if API returns it.
use Resource Skus - List or
az vm list-skus --resource-type virtualMachines --location eastus2 --query "[?name=='Standard_D2s_v3'].locationInfo[0].zoneDetails[0]"
, you will find the api returnsName
instead ofname
.Here I use a simple program to reproduce: