feat(JsonExtensions): create to be able to make fluent Json serilization
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
#if NET
|
||||
#if NET
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
#endif
|
||||
@@ -12,15 +10,14 @@ 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()
|
||||
#if NET
|
||||
public static readonly JsonSerializerOptions ForDiagnostics = new()
|
||||
{
|
||||
ContractResolver = new CamelCasePropertyNamesContractResolver(),
|
||||
Formatting = Formatting.Indented,
|
||||
NullValueHandling = NullValueHandling.Include
|
||||
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
|
||||
WriteIndented = true,
|
||||
DefaultIgnoreCondition = JsonIgnoreCondition.Never
|
||||
};
|
||||
|
||||
#if NET
|
||||
public static readonly JsonSerializerOptions ForAnnotations = new()
|
||||
{
|
||||
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
|
||||
|
||||
Reference in New Issue
Block a user