From 307e4e647cf67b812ed105e3007dab51aa4c283a Mon Sep 17 00:00:00 2001 From: Peter Ombwa Date: Tue, 8 Nov 2022 13:32:43 -0800 Subject: [PATCH] Fix serialization of Hashtables. --- src/readme.graph.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/readme.graph.md b/src/readme.graph.md index d994cd53395..a992b05b32a 100644 --- a/src/readme.graph.md +++ b/src/readme.graph.md @@ -714,6 +714,21 @@ directive: return $; } +# Modify generated DictionaryExtensions. + - from: source-file-csharp + where: $ + transform: > + if (!$documentPath.match(/generated%5Cruntime%5CDictionaryExtensions.cs/gm)) + { + return $; + } else { + // Replace HashTableToDictionary call. + let hashtableRegex = /(HashTableToDictionary\(nested, new System\.Collections\.Generic\.Dictionary\(\)\);)/gm + $ = $.replace(hashtableRegex, 'try {dictionary[key] = (V)value;} catch {}'); + + return $; + } + # Serialize all $count parameter to lowercase true or false. - from: source-file-csharp where: $