Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts: # build/azure-pipelines.yml # src/Umbraco.Core/Constants-Configuration.cs # src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Configuration.cs # src/Umbraco.Core/Factories/IDatabaseSettingsFactory.cs # src/Umbraco.Core/Factories/IInstallSettingsFactory.cs # src/Umbraco.Core/Factories/IUpgradeSettingsFactory.cs # src/Umbraco.Core/Factories/InstallSettingsFactory.cs # src/Umbraco.Core/Factories/UpgradeSettingsFactory.cs # src/Umbraco.Core/Factories/UserSettingsFactory.cs # src/Umbraco.Core/Installer/IInstallStep.cs # src/Umbraco.Core/Installer/IUpgradeStep.cs # src/Umbraco.Core/Installer/NewInstallStepCollection.cs # src/Umbraco.Core/Installer/NewInstallStepCollectionBuilder.cs # src/Umbraco.Core/Installer/Steps/FilePermissionsStep.cs # src/Umbraco.Core/Installer/Steps/RestartRuntimeStep.cs # src/Umbraco.Core/Installer/Steps/TelemetryIdentifierStep.cs # src/Umbraco.Core/Installer/UpgradeStepCollection.cs # src/Umbraco.Core/Installer/UpgradeStepCollectionBuilder.cs # src/Umbraco.Core/Models/Blocks/RichTextBlockLayoutItem.cs # src/Umbraco.Core/Models/Blocks/RichTextEditorBlockDataConverter.cs # src/Umbraco.Core/Models/Configuration/NewBackOfficeSettings.cs # src/Umbraco.Core/Models/Configuration/NewBackOfficeSettingsValidator.cs # src/Umbraco.Core/Models/Installer/ConsentLevelModel.cs # src/Umbraco.Core/Models/Installer/DatabaseInstallData.cs # src/Umbraco.Core/Models/Installer/DatabaseSettingsModel.cs # src/Umbraco.Core/Models/Installer/InstallData.cs # src/Umbraco.Core/Models/Installer/InstallSettingsModel.cs # src/Umbraco.Core/Models/Installer/PasswordSettingsModel.cs # src/Umbraco.Core/Models/Installer/UpgradeSettingsModel.cs # src/Umbraco.Core/Models/Installer/UserInstallData.cs # src/Umbraco.Core/Models/Installer/UserSettingsModel.cs # src/Umbraco.Core/Models/OutOfDateType.cs # src/Umbraco.Core/PaginationHelper.cs # src/Umbraco.Core/Services/Installer/IInstallService.cs # src/Umbraco.Core/Services/Installer/IUpgradeService.cs # src/Umbraco.Core/Services/Installer/InstallService.cs # src/Umbraco.Core/Services/Installer/UpgradeService.cs # src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Repositories.cs # src/Umbraco.Infrastructure/Factories/Installer/DatabaseSettingsFactory.cs # src/Umbraco.Infrastructure/Installer/Steps/CreateUserStep.cs # src/Umbraco.Infrastructure/Installer/Steps/DatabaseConfigureStep.cs # src/Umbraco.Infrastructure/Installer/Steps/DatabaseInstallStep.cs # src/Umbraco.Infrastructure/Installer/Steps/DatabaseUpgradeStep.cs # src/Umbraco.Infrastructure/Installer/Steps/RegisterInstallCompleteStep.cs # src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs # src/Umbraco.Infrastructure/Models/Blocks/BlockEditorDataConverter.cs # src/Umbraco.Infrastructure/PropertyEditors/BlockEditorPropertyValueEditor.cs # src/Umbraco.Infrastructure/PropertyEditors/BlockEditorValidator.cs # src/Umbraco.Infrastructure/PropertyEditors/BlockEditorValues.cs # src/Umbraco.Infrastructure/PropertyEditors/RichTextPropertyEditor.cs # src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/BlockGridPropertyValueConverter.cs # src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/BlockListPropertyValueConverter.cs # src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/BlockPropertyValueConverterBase.cs # src/Umbraco.Infrastructure/Security/IBackOfficeApplicationManager.cs # src/Umbraco.Infrastructure/Services/IIndexingRebuilderService.cs # src/Umbraco.Infrastructure/Services/IndexingRebuilderService.cs # src/Umbraco.New.Cms.Core/Umbraco.New.Cms.Core.csproj # src/Umbraco.New.Cms.Infrastructure/Umbraco.New.Cms.Infrastructure.csproj # src/Umbraco.New.Cms.Web.Common/Umbraco.New.Cms.Web.Common.csproj # tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/content.spec.ts # tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Login/login.spec.ts # tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/BlockListPropertyValueConverterTests.cs # version.json
This commit is contained in:
@@ -10,10 +10,8 @@ public class ConfigurationEditorJsonSerializer : JsonNetSerializer, IConfigurati
|
||||
{
|
||||
public ConfigurationEditorJsonSerializer()
|
||||
{
|
||||
JsonSerializerSettings.Converters.Add(new FuzzyBooleanConverter());
|
||||
JsonSerializerSettings.ContractResolver = new ConfigurationCustomContractResolver();
|
||||
JsonSerializerSettings.Formatting = Formatting.None;
|
||||
JsonSerializerSettings.NullValueHandling = NullValueHandling.Ignore;
|
||||
Settings.Converters.Add(new FuzzyBooleanConverter());
|
||||
Settings.ContractResolver = new ConfigurationCustomContractResolver();
|
||||
}
|
||||
|
||||
private class ConfigurationCustomContractResolver : DefaultContractResolver
|
||||
|
||||
@@ -7,23 +7,20 @@ namespace Umbraco.Cms.Infrastructure.Serialization;
|
||||
|
||||
public class JsonNetSerializer : IJsonSerializer
|
||||
{
|
||||
protected static readonly JsonSerializerSettings JsonSerializerSettings = new()
|
||||
protected JsonSerializerSettings Settings { get; } = new()
|
||||
{
|
||||
Converters = new List<JsonConverter> { new StringEnumConverter() },
|
||||
Formatting = Formatting.None,
|
||||
NullValueHandling = NullValueHandling.Ignore,
|
||||
};
|
||||
|
||||
public string Serialize(object? input) => JsonConvert.SerializeObject(input, JsonSerializerSettings);
|
||||
public string Serialize(object? input) => JsonConvert.SerializeObject(input, Settings);
|
||||
|
||||
public T? Deserialize<T>(string input) => JsonConvert.DeserializeObject<T>(input, JsonSerializerSettings);
|
||||
public T? Deserialize<T>(string input) => JsonConvert.DeserializeObject<T>(input, Settings);
|
||||
|
||||
public T? DeserializeSubset<T>(string input, string key)
|
||||
{
|
||||
if (key == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(key));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(key);
|
||||
|
||||
JObject? root = Deserialize<JObject>(input);
|
||||
JToken? jToken = root?.SelectToken(key);
|
||||
|
||||
Reference in New Issue
Block a user