From 6bf33de791d718ef5eded4e783ace3db982fdef2 Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 16 Sep 2021 16:53:19 +0800 Subject: [PATCH 1/3] JSON Numbers can be read from string. --- .../Volo/Abp/AspNetCore/Mvc/Json/AbpJsonOptionsSetup.cs | 2 +- .../ValueConverters/ExtraPropertiesValueConverter.cs | 2 +- .../SystemTextJson/AbpSystemTextJsonSerializerOptionsSetup.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Json/AbpJsonOptionsSetup.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Json/AbpJsonOptionsSetup.cs index 3c09cbfd1e..101b369a36 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Json/AbpJsonOptionsSetup.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Json/AbpJsonOptionsSetup.cs @@ -33,7 +33,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Json // Remove after this PR. // https://github.com/dotnet/runtime/pull/57525 - options.JsonSerializerOptions.NumberHandling = JsonNumberHandling.Strict; + options.JsonSerializerOptions.NumberHandling = JsonNumberHandling.AllowReadingFromString; } } } diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ValueConverters/ExtraPropertiesValueConverter.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ValueConverters/ExtraPropertiesValueConverter.cs index 85af6add3d..f9e70848c8 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ValueConverters/ExtraPropertiesValueConverter.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ValueConverters/ExtraPropertiesValueConverter.cs @@ -53,7 +53,7 @@ namespace Volo.Abp.EntityFrameworkCore.ValueConverters // Remove after this PR. // https://github.com/dotnet/runtime/pull/57525 - deserializeOptions.NumberHandling = JsonNumberHandling.Strict; + deserializeOptions.NumberHandling = JsonNumberHandling.AllowReadingFromString; var dictionary = JsonSerializer.Deserialize(extraPropertiesAsJson, deserializeOptions) ?? new ExtraPropertyDictionary(); diff --git a/framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/AbpSystemTextJsonSerializerOptionsSetup.cs b/framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/AbpSystemTextJsonSerializerOptionsSetup.cs index 61586823cb..8f28f20cc4 100644 --- a/framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/AbpSystemTextJsonSerializerOptionsSetup.cs +++ b/framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/AbpSystemTextJsonSerializerOptionsSetup.cs @@ -32,7 +32,7 @@ namespace Volo.Abp.Json.SystemTextJson // Remove after this PR. // https://github.com/dotnet/runtime/pull/57525 - options.JsonSerializerOptions.NumberHandling = JsonNumberHandling.Strict; + options.JsonSerializerOptions.NumberHandling = JsonNumberHandling.AllowReadingFromString; } } } From 2e39b4cac1503577f797d688243e6a1ee2b9b6a6 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Thu, 16 Sep 2021 17:22:37 +0800 Subject: [PATCH 2/3] Add volo.abp.json reference to the application.contracts layer --- .../Volo.Abp.FeatureManagement.Application.Contracts.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo.Abp.FeatureManagement.Application.Contracts.csproj b/modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo.Abp.FeatureManagement.Application.Contracts.csproj index 451f9e0291..63fcdae1f4 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo.Abp.FeatureManagement.Application.Contracts.csproj +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo.Abp.FeatureManagement.Application.Contracts.csproj @@ -11,6 +11,7 @@ + From 195fbdefb9fa54f6793cf3cb02a97c3c5ada7587 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Thu, 16 Sep 2021 17:25:29 +0800 Subject: [PATCH 3/3] Update AbpFeatureManagementApplicationContractsModule.cs --- .../AbpFeatureManagementApplicationContractsModule.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/AbpFeatureManagementApplicationContractsModule.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/AbpFeatureManagementApplicationContractsModule.cs index 854a9f7ff6..18661e742a 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/AbpFeatureManagementApplicationContractsModule.cs +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/AbpFeatureManagementApplicationContractsModule.cs @@ -2,6 +2,7 @@ using Volo.Abp.Application; using Volo.Abp.Authorization; using Volo.Abp.FeatureManagement.JsonConverters; +using Volo.Abp.Json; using Volo.Abp.Json.Newtonsoft; using Volo.Abp.Json.SystemTextJson; using Volo.Abp.Modularity; @@ -12,7 +13,8 @@ namespace Volo.Abp.FeatureManagement [DependsOn( typeof(AbpFeatureManagementDomainSharedModule), typeof(AbpDddApplicationContractsModule), - typeof(AbpAuthorizationAbstractionsModule) + typeof(AbpAuthorizationAbstractionsModule), + typeof(AbpJsonModule) )] public class AbpFeatureManagementApplicationContractsModule : AbpModule {