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
2 changes: 1 addition & 1 deletion powershell/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@autorest/powershell",
"version": "2.1.600",
"version": "2.1.700",
"description": "AutoRest PowerShell Cmdlet Generator",
"main": "dist/exports.js",
"typings": "dist/exports.d.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,14 @@ internal static JsonNode ToJsonValue(object value)
return Microsoft.Rest.ClientRuntime.JsonSerializable.ToJson(dictionary, null);
}

// hashtables are converted to dictionaries for serialization
if (value is System.Collections.Hashtable hashtable)
{
var dict = new System.Collections.Generic.Dictionary<string, object>();
DictionaryExtensions.HashTableToDictionary<object>(hashtable, dict);
return Microsoft.Rest.ClientRuntime.JsonSerializable.ToJson(dict, null);
}

// enumerable collections are handled like arrays (again, fallback to ToJson()/ToJsonString() or literal JsonString)
if (value is System.Collections.IEnumerable enumerableValue)
{
Expand Down