Skip to content

Commit 37d686a

Browse files
committed
Make excludes hashset in IJsonSerializable case-insensitive.
1 parent 9363eac commit 37d686a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/readme.graph.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,20 @@ directive:
560560
return $;
561561
}
562562
563+
# Modify generated runtime IJsonSerializable class.
564+
- from: source-file-csharp
565+
where: $
566+
transform: >
567+
if (!$documentPath.match(/generated%5Cruntime%5CCustomizations%5CIJsonSerializable.cs/gm))
568+
{
569+
return $;
570+
} else {
571+
// Changes excludes hashset to a case-insensitive hashset.
572+
let fromJsonRegex = /(\s*FromJson<\w*>\s*\(JsonObject\s*json\s*,\s*System\.Collections\.Generic\.IDictionary.*)(\s*)({)/gm
573+
$ = $.replace(fromJsonRegex, '$1$2$1\n$2 if (excludes != null){ excludes = new System.Collections.Generic.HashSet<string>(excludes, global::System.StringComparer.OrdinalIgnoreCase);}');
574+
return $;
575+
}
576+
563577
# Serialize all $count parameter to lowercase true or false.
564578
- from: source-file-csharp
565579
where: $

0 commit comments

Comments
 (0)