Refactor OpenInsight file handling to utilize JsonElement for data processing and enhance serialization with JsonSourceGeneration. Updated methods across multiple classes to improve data handling and reduce dependencies on ProcessDataStandardFormat.

This commit is contained in:
2025-09-08 15:31:55 -07:00
parent 7739ff03a2
commit 48ad90c0f1
12 changed files with 149 additions and 140 deletions

View File

@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace Adaptation.Shared.Duplicator;
@ -178,4 +179,16 @@ public class Description : IDescription, Properties.IDescription
internal static string GetDateFormat() => "MM/dd/yyyy hh:mm:ss tt";
}
[JsonSourceGenerationOptions(WriteIndented = true, NumberHandling = JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString)]
[JsonSerializable(typeof(Description))]
internal partial class SharedDescriptionSourceGenerationContext : JsonSerializerContext
{
}
[JsonSourceGenerationOptions(WriteIndented = true, NumberHandling = JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString)]
[JsonSerializable(typeof(Description[]))]
internal partial class SharedDescriptionArraySourceGenerationContext : JsonSerializerContext
{
}