feat(JsonExtensions): create to be able to make fluent Json serilization

This commit is contained in:
2025-09-10 15:55:56 +02:00
parent e990a466aa
commit 95b54fa1f1
6 changed files with 33 additions and 14 deletions

View File

@@ -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,