diff --git a/DysonNetwork.Shared/Proto/GrpcTypeHelper.cs b/DysonNetwork.Shared/Proto/GrpcTypeHelper.cs index 03f2d53..e30761e 100644 --- a/DysonNetwork.Shared/Proto/GrpcTypeHelper.cs +++ b/DysonNetwork.Shared/Proto/GrpcTypeHelper.cs @@ -14,6 +14,13 @@ namespace DysonNetwork.Shared.Proto; public abstract class GrpcTypeHelper { + public static readonly JsonSerializerOptions? SerializerOptionsWithIgnore = new JsonSerializerOptions() + { + PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower, + DefaultIgnoreCondition = JsonIgnoreCondition.Never, + PropertyNameCaseInsensitive = true, + }.ConfigureForNodaTime(DateTimeZoneProviders.Tzdb); + public static readonly JsonSerializerOptions? SerializerOptions = new JsonSerializerOptions() { PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower, diff --git a/DysonNetwork.Sphere/WebReader/EmbeddableBase.cs b/DysonNetwork.Sphere/WebReader/EmbeddableBase.cs index 28d9ee3..50aceca 100644 --- a/DysonNetwork.Sphere/WebReader/EmbeddableBase.cs +++ b/DysonNetwork.Sphere/WebReader/EmbeddableBase.cs @@ -31,7 +31,13 @@ public abstract class EmbeddableBase public static Dictionary ToDictionary(dynamic input) { - var jsonRaw = JsonSerializer.Serialize(input, GrpcTypeHelper.SerializerOptions); - return JsonSerializer.Deserialize>(jsonRaw, GrpcTypeHelper.SerializerOptions); + var jsonRaw = JsonSerializer.Serialize( + input, + GrpcTypeHelper.SerializerOptionsWithIgnore + ); + return JsonSerializer.Deserialize>( + jsonRaw, + GrpcTypeHelper.SerializerOptionsWithIgnore + ); } } \ No newline at end of file