Skip to content

Commit f65b54c

Browse files
authored
Ensure all properties in additionalProperties bag are serialized in camel case. (#1095)
1 parent 6de139b commit f65b54c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/readme.graph.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,13 @@ directive:
678678
let fromJsonRegex = /(\s*FromJson<\w*>\s*\(JsonObject\s*json\s*,\s*System\.Collections\.Generic\.IDictionary.*)(\s*)({)/gm
679679
$ = $.replace(fromJsonRegex, '$1$2$3\n$2 if (excludes != null){ excludes = new System.Collections.Generic.HashSet<string>(excludes, global::System.StringComparer.OrdinalIgnoreCase);}');
680680
681+
let toFirstUpperImplementation = 'internal static string ToFirstCharacterLowerCase(this string text) => String.IsNullOrEmpty(text) ? text : $"{char.ToLowerInvariant(text[0])}{text.Substring(1)}";'
682+
let classRegex = /(internal\sstatic\sclass\sJsonSerializable(\s*){)/gm
683+
$ = $.replace(classRegex, `$1$2${toFirstUpperImplementation}`)
684+
685+
let directoryKeyRegex = /(container\.Add\(key\.Key)(,)/gm
686+
$ = $.replace(directoryKeyRegex, '$1.ToFirstCharacterLowerCase()$2')
687+
681688
return $;
682689
}
683690

0 commit comments

Comments
 (0)