Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Resources/ResourceManager/Json/PSJsonSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ private static object ProcessValue(object value, int currentDepth, SerializeCont
return value;
}

if (value is JValue jValue)
{
return jValue.Value<object>();
}

if (value is JObject jObject)
{
return jObject.ToObject<Dictionary<object, object>>();
Expand Down
40 changes: 38 additions & 2 deletions src/Resources/Resources.Test/Json/PSJsonSerializerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,25 @@ public void Serialize_Hashtable_Success()
["bar"] = true,
["nested"] = new Hashtable
{
["foo"] = new PSObject(Guid.Parse("4d44fe86-f04a-4ba5-9900-abdec8cb11c1"))
["foo"] = new PSObject(Guid.Parse("4d44fe86-f04a-4ba5-9900-abdec8cb11c1")),
["bar"] = new object[]
{
"test",
true,
123,
new Hashtable
{
["deepNested"] = new PSObject("leaf"),
["array"] = new object[]
{
new PSObject("abc"),
new PSObject(new
{
stuff = false
})
}
}
}
}
};

Expand All @@ -79,7 +97,25 @@ public void Serialize_Hashtable_Success()
bar = true,
nested = new
{
foo = "4d44fe86-f04a-4ba5-9900-abdec8cb11c1"
foo = "4d44fe86-f04a-4ba5-9900-abdec8cb11c1",
bar = new object[]
{
"test",
true,
123,
new
{
deepNested = "leaf",
array = new object[]
{
"abc",
new
{
stuff = false
}
}
}
}
}
});
Assert.True(JToken.DeepEquals(expected, parsedResult));
Expand Down
6 changes: 3 additions & 3 deletions src/Resources/Resources/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
- Additional information about change #1
-->
## Upcoming Release
* Added breaking change attribute to `SubscriptionId` parameter of `Get-AzResourceGroupDeploymentOperation`.
* Updated ARM template What-If cmdlets to show "Ignore" resource changes last.
* Fixed an issue where dynamic secure string parameters for deployment cmdlets are not correctly serialized.
* Added breaking change attribute to `SubscriptionId` parameter of `Get-AzResourceGroupDeploymentOperation`
* Updated ARM template What-If cmdlets to show "Ignore" resource changes last
* Fixed secure and array parameter serialization issues for deployment cmdlets [#12773]

## Version 2.5.0
* Updated `Get-AzPolicyAlias` response to include information indicating whether the alias is modifiable by Azure Policy.
Expand Down