🐛 Enable JsonNumberHandling.AllowNamedFloatingPointLiterals global wide

This commit is contained in:
2025-09-07 14:39:25 +08:00
parent 9492b6cac6
commit 52430c19a5
9 changed files with 18 additions and 0 deletions

View File

@@ -210,6 +210,7 @@ public class CacheServiceRedis : ICacheService
Modifiers = { JsonExtensions.UnignoreAllProperties() },
},
ReferenceHandler = ReferenceHandler.Preserve,
NumberHandling = JsonNumberHandling.AllowNamedFloatingPointLiterals,
};
_jsonOptions.ConfigureForNodaTime(DateTimeZoneProviders.Tzdb);
_jsonOptions.PropertyNameCaseInsensitive = true;

View File

@@ -16,6 +16,7 @@ public abstract class GrpcTypeHelper
{
public static readonly JsonSerializerOptions? SerializerOptionsWithIgnore = new JsonSerializerOptions()
{
NumberHandling = JsonNumberHandling.AllowNamedFloatingPointLiterals,
PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower,
DefaultIgnoreCondition = JsonIgnoreCondition.Never,
PropertyNameCaseInsensitive = true,
@@ -23,6 +24,7 @@ public abstract class GrpcTypeHelper
public static readonly JsonSerializerOptions? SerializerOptions = new JsonSerializerOptions()
{
NumberHandling = JsonNumberHandling.AllowNamedFloatingPointLiterals,
PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower,
DefaultIgnoreCondition = JsonIgnoreCondition.Never,
PropertyNameCaseInsensitive = true,