refactor(AnnotationHandler): update to use System.Text.Json.JsonSerializer
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
#if NET
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
#endif
|
||||
|
||||
namespace EnvelopeGenerator.Domain.Constants
|
||||
{
|
||||
@@ -8,18 +12,22 @@ namespace EnvelopeGenerator.Domain.Constants
|
||||
#region Json Serializer Settings
|
||||
public static class Json
|
||||
{
|
||||
//TODO: update to use System.Text.Json
|
||||
public static readonly JsonSerializerSettings ForDiagnostics = new JsonSerializerSettings()
|
||||
{
|
||||
ContractResolver = new CamelCasePropertyNamesContractResolver(),
|
||||
Formatting = Formatting.Indented,
|
||||
NullValueHandling = NullValueHandling.Include
|
||||
};
|
||||
public static readonly JsonSerializerSettings ForAnnotations = new JsonSerializerSettings()
|
||||
|
||||
#if NET
|
||||
public static readonly JsonSerializerOptions ForAnnotations = new()
|
||||
{
|
||||
ContractResolver = new CamelCasePropertyNamesContractResolver(),
|
||||
Formatting = Formatting.None,
|
||||
NullValueHandling = NullValueHandling.Ignore
|
||||
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
|
||||
WriteIndented = false,
|
||||
DefaultIgnoreCondition = JsonIgnoreCondition.Never,
|
||||
};
|
||||
#endif
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user