@autorest/powershell 3.0.463 → 3.0.464

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -71,7 +71,7 @@
71
71
  "powershell/models/model-extensions.ts": "9394418ac00c3e8829760432053c087642e4222d",
72
72
  "powershell/module/module-class.ts": "fe4c02a9ce6cf923959142c0cb42d686b2efb501",
73
73
  "powershell/module/module-namespace.ts": "f6afc90087e8d733f0323b0de8ba41d923955732",
74
- "powershell/package.json": "b717100a6488f029dd33523e18d71e73436d8df6",
74
+ "powershell/package.json": "1c39245028eea6df93b8b72e47f0531775191e94",
75
75
  "powershell/plugins/add-azure-completers-v2.ts": "557ce4326318c82f91445490a162f20fa029fed3",
76
76
  "powershell/plugins/create-commands-v2.ts": "fc36205364fa4d2aa9c0fc655dcd9a7f6f1d4063",
77
77
  "powershell/plugins/cs-namer-v2.ts": "e294a2f5ac3db421d030a3bba8343a3d4a9ea6ab",
@@ -268,7 +268,7 @@
268
268
  "powershell/resources/runtime/csharp/json/Conversions/JsonConverterAttribute.cs": "b999ac4093334974db5577f9dbd1cd426a51600a",
269
269
  "powershell/resources/runtime/csharp/json/Conversions/JsonConverterFactory.cs": "a7321344d4b56774730cb45fe28a7380b4c64c81",
270
270
  "powershell/resources/runtime/csharp/json/Conversions/StringLikeConverter.cs": "9fa0e8b8c47c47a73f8e05b4564c85a4e1bded8c",
271
- "powershell/resources/runtime/csharp/json/Customizations/IJsonSerializable.cs": "b4fb59d1806547eed798b1b327c7558c2f0b6c56",
271
+ "powershell/resources/runtime/csharp/json/Customizations/IJsonSerializable.cs": "ceb12aa7026afc64719e3ae1b090a7b5bbb440b8",
272
272
  "powershell/resources/runtime/csharp/json/Customizations/JsonArray.cs": "63d8c7726033272331828be25fbc748948615f57",
273
273
  "powershell/resources/runtime/csharp/json/Customizations/JsonBoolean.cs": "e71e2df3781ef83c580413c8747c6703cc21ed40",
274
274
  "powershell/resources/runtime/csharp/json/Customizations/JsonNode.cs": "cd7770bee8f5a54df645bbd7568a56de05ba2a55",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autorest/powershell",
3
- "version": "3.0.463",
3
+ "version": "3.0.464",
4
4
  "description": "AutoRest PowerShell Cmdlet Generator",
5
5
  "main": "dist/exports.js",
6
6
  "typings": "dist/exports.d.ts",
@@ -75,12 +75,18 @@ namespace Microsoft.Rest.ClientRuntime
75
75
  return new JsonBoolean(bValue);
76
76
  }
77
77
 
78
- // dates
78
+ // dates
79
79
  if (vValue is DateTime dtValue)
80
80
  {
81
81
  return new JsonDate(dtValue);
82
82
  }
83
83
 
84
+ // DictionaryEntity struct type
85
+ if (vValue is System.Collections.DictionaryEntry deValue)
86
+ {
87
+ return new JsonObject { { deValue.Key.ToString(), ToJsonValue(deValue.Value) } };
88
+ }
89
+
84
90
  // sorry, no idea.
85
91
  return null;
86
92
  }
@@ -113,7 +119,7 @@ namespace Microsoft.Rest.ClientRuntime
113
119
  // if we got something out, let's use it.
114
120
  if (null != jsonValue)
115
121
  {
116
- // JsonNumber is really a literal json value. Just don't try to cast that back to an actual number, ok?
122
+ // JsonNumber is really a literal json value. Just don't try to cast that back to an actual number, ok?
117
123
  return new JsonNumber(jsonValue.ToString());
118
124
  }
119
125
 
@@ -127,7 +133,7 @@ namespace Microsoft.Rest.ClientRuntime
127
133
  /// <returns>the serialized JsonNode (if successful), otherwise, <c>null</c></returns>
128
134
  internal static JsonNode ToJsonValue(object value)
129
135
  {
130
- // things that implement our interface are preferred.
136
+ // things that implement our interface are preferred.
131
137
  if (value is Microsoft.Rest.ClientRuntime.IJsonSerializable jsonSerializable)
132
138
  {
133
139
  return jsonSerializable.ToJson();
@@ -139,7 +145,7 @@ namespace Microsoft.Rest.ClientRuntime
139
145
  return new JsonString(value.ToString());
140
146
  }
141
147
 
142
- // value types are fairly straightforward (fallback to ToJson()/ToJsonString() or literal JsonString )
148
+ // value types are fairly straightforward (fallback to ToJson()/ToJsonString() or literal JsonString )
143
149
  if (value is System.ValueType vValue)
144
150
  {
145
151
  return ToJsonValue(vValue) ?? TryToJsonValue(vValue) ?? new JsonString(vValue.ToString());
@@ -159,7 +165,7 @@ namespace Microsoft.Rest.ClientRuntime
159
165
  return Microsoft.Rest.ClientRuntime.JsonSerializable.ToJson(dict, null);
160
166
  }
161
167
 
162
- // enumerable collections are handled like arrays (again, fallback to ToJson()/ToJsonString() or literal JsonString)
168
+ // enumerable collections are handled like arrays (again, fallback to ToJson()/ToJsonString() or literal JsonString)
163
169
  if (value is System.Collections.IEnumerable enumerableValue)
164
170
  {
165
171
  // some kind of enumerable value
@@ -185,7 +191,7 @@ namespace Microsoft.Rest.ClientRuntime
185
191
  {
186
192
  foreach (var key in dictionary)
187
193
  {
188
- // currently, we don't serialize null values.
194
+ // currently, we don't serialize null values.
189
195
  if (null != key.Value)
190
196
  {
191
197
  container.Add(key.Key, ToJsonValue(key.Value));