Azure-sdk-for-go: if all properties in a struct are readOnly, do not serialize this struct when sending request

Created on 31 Mar 2021  路  3Comments  路  Source: Azure/azure-sdk-for-go

Feature Request

track1 go sdk
bug encountered: if a resource enable user assigned identity, it's common that we get the resource first, then modify the fields and fire the update api request. The backend service will report error:

Invalid value for the identities '/subscriptions/sub-id/resourceGroups/resource-group-name/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name'. The 'UserAssignedIdentities' property keys should only be empty json objects, null or the resource exisiting property."

this cause a lot of trouble for users

https://github.com/terraform-providers/terraform-provider-azurerm/issues/10406

Mgmt bug codegen

Most helpful comment

Hi @ArcturusZhang , any progress on this issue?

All 3 comments

Hi @njuCZ thanks for this issue!

Hey @jhendrixMSFT we could simply fix this by generating marshaller for all structs with only read-only properties - returning an empty JSON string. But should we do this considering that we are having this issue?

Hi @ArcturusZhang , any progress on this issue?

We will enroll this change in this month's major version release.

Was this page helpful?
0 / 5 - 0 ratings