Skip to content

Commit e058e01

Browse files
committed
Add null to GetJsonCompatibleString
1 parent 40c224b commit e058e01

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Microsoft.OpenApi/Writers/SpecialCharacterStringExtensions.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,11 @@ internal static string GetYamlCompatibleString(this string input)
196196
/// </summary>
197197
internal static string GetJsonCompatibleString(this string value)
198198
{
199+
if (value == null)
200+
{
201+
return "null";
202+
}
203+
199204
// Show the control characters as strings
200205
// http://json.org/
201206

0 commit comments

Comments
 (0)