diff --git a/src/Criteo.OpenApi.Comparator.Cli/Program.cs b/src/Criteo.OpenApi.Comparator.Cli/Program.cs index d9f978c..ff743be 100644 --- a/src/Criteo.OpenApi.Comparator.Cli/Program.cs +++ b/src/Criteo.OpenApi.Comparator.Cli/Program.cs @@ -6,6 +6,7 @@ using System.IO; using System.Linq; using System.Net.Http; +using System.Text.Encodings.Web; using System.Text.Json; using System.Text.Json.Serialization; @@ -120,7 +121,8 @@ private static void DisplayOutput(IEnumerable differences, Ou var serializerOptions = new JsonSerializerOptions { WriteIndented = true, - Converters = { new JsonStringEnumConverter() } + Converters = { new JsonStringEnumConverter() }, + Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, }; Console.WriteLine(JsonSerializer.Serialize(differences, serializerOptions)); return; diff --git a/src/Criteo.OpenApi.Comparator.UTest/OpenApiSpecificationsCompareTests.cs b/src/Criteo.OpenApi.Comparator.UTest/OpenApiSpecificationsCompareTests.cs index 3874eab..791b678 100644 --- a/src/Criteo.OpenApi.Comparator.UTest/OpenApiSpecificationsCompareTests.cs +++ b/src/Criteo.OpenApi.Comparator.UTest/OpenApiSpecificationsCompareTests.cs @@ -9,6 +9,7 @@ using Criteo.OpenApi.Comparator.Logging; using System.Collections.Generic; using System.Linq; +using System.Text.Encodings.Web; namespace Criteo.OpenApi.Comparator.UTest; @@ -30,7 +31,8 @@ public class OpenApiSpecificationsCompareTests private static readonly JsonSerializerOptions serializerOptions = new() { WriteIndented = true, - Converters = { new JsonStringEnumConverter() } + Converters = { new JsonStringEnumConverter() }, + Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, }; [TestCaseSource(nameof(TestCases))]