Updates to Core.Configuration Models to use DefaultValue attribute to allow auto generated JSONSchema to give a default value in schema

This commit is contained in:
Warren Buckley
2021-07-05 14:27:49 +01:00
parent cd36d050c5
commit 6b73ea767f
28 changed files with 372 additions and 106 deletions

View File

@@ -1,8 +1,7 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.
using System;
using Umbraco.Cms.Core.Hosting;
using System.ComponentModel;
namespace Umbraco.Cms.Core.Configuration.Models
{
@@ -12,10 +11,13 @@ namespace Umbraco.Cms.Core.Configuration.Models
[UmbracoOptions(Constants.Configuration.ConfigKeepAlive)]
public class KeepAliveSettings
{
internal const bool StaticDisableKeepAliveTask = false;
/// <summary>
/// Gets or sets a value indicating whether the keep alive task is disabled.
/// </summary>
public bool DisableKeepAliveTask { get; set; } = false;
[DefaultValue(StaticDisableKeepAliveTask)]
public bool DisableKeepAliveTask { get; set; } = StaticDisableKeepAliveTask;
/// <summary>
/// Gets a value for the keep alive ping URL.