You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The third parameter of JsonSerializable.FromJson() should specify how the value object is deserialized, but it's null.
Work-around
Currently the work-around is to write a custom class to implement BeforeFromJson method. For example:
publicpartialclassResourceIdentityUserAssignedIdentities{partialvoidBeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Json.JsonObject json,refboolreturnNow){// Perform deserialization using the appropriate object factory for user identity
Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.JsonSerializable.FromJson(
json,((Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.IAssociativeArray<Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Models.Api20191101Preview.IUserIdentity>)this).AdditionalProperties,(identity)=> UserIdentity.FromJson(identity),null);returnNow=true;}}
The text was updated successfully, but these errors were encountered:
Current behavior
When a model is defined to have
additionalProperties
(aka it's a dictionary) and its value type is object, for example https://github.com/Azure/azure-rest-api-specs/blob/29446bf77d48b7128b0c6d587b78355c2b4dde73/specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2019-11-01-preview/appconfiguration.json#L1303those additional properties are lost during deserialization, resulting an empty dictionary.
Root cause
The generated code for deserialization is like:
The third parameter of
JsonSerializable.FromJson()
should specify how the value object is deserialized, but it's null.Work-around
Currently the work-around is to write a custom class to implement
BeforeFromJson
method. For example:The text was updated successfully, but these errors were encountered: