Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Evidently the individual properties of JsonSerializerSettings are coalesced up to the default. I absolutely do not agree with this moving-target approach of n settings that may impact any consumer. In netstandard2.1 when BCL APIs for JSON re-appear this problem set should go away.
  • Loading branch information
NickCraver committed Nov 11, 2018
1 parent 1490172 commit 45a4e4a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/MiniProfiler.Shared/Internal/ExtensionMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace StackExchange.Profiling.Internal
{
Expand Down Expand Up @@ -77,13 +78,15 @@ public static string ToJson(this List<Guid> guids)

private static readonly JsonSerializerSettings defaultSettings = new JsonSerializerSettings
{
NullValueHandling = NullValueHandling.Ignore
NullValueHandling = NullValueHandling.Ignore,
ContractResolver = new DefaultContractResolver()
};

private static readonly JsonSerializerSettings htmlEscapeSettings = new JsonSerializerSettings
{
StringEscapeHandling = StringEscapeHandling.EscapeHtml,
NullValueHandling = NullValueHandling.Ignore
NullValueHandling = NullValueHandling.Ignore,
ContractResolver = new DefaultContractResolver()
};

/// <summary>
Expand Down

0 comments on commit 45a4e4a

Please sign in to comment.