{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "definitions": {
    "webOptimizer": {
      "title": "web optimizer",
      "type": "object",
      "description": "Settings for WebOptimizer.Core",
      "properties": {
        "enableCaching": {
          "description": "Determines if the \"cache-control\" HTTP headers should be set and if conditional GET (304) requests should be supported. This could be helpful to disable while in development mode.",
          "type": "boolean"
        },
        "enableTagHelperBundling": {
          "description": "Determines if `<script>` and `<link>` elements should point to the bundled path or a reference per source file should be created. This is helpful to disable when in development mode.",
          "type": "boolean",
          "default": true
        }
      }
    },
    "cdn": {
      "title": "CDN",
      "type": "object",
      "description": "Definitions for WebEssentials.AspNetCore.CdnTagHelpers",
      "properties": {
        "url": {
          "description": "An absolute URL used as a prefix for static resources",
          "type": "string",
          "pattern": "^((//|https?://).+|)$"
        },
        "prefetch": {
          "description": "If true, injects a <link rel='dns-prefetch'> tag that speeds up DNS resolution to the CDN.",
          "type": "boolean",
          "default": true
        }
      }
    },
    "pwa": {
      "properties": {
        "cacheId": {
          "description": "The cache identifier of the service worker (can be any string). Change this property to force the service worker to reload in browsers.",
          "type": "string",
          "default": "v1.0"
        },
        "offlineRoute": {
          "description": "The route to the page to show when offline.",
          "type": "string",
          "default": "/offline.html"
        },
        "registerServiceWorker": {
          "description": "Determines if a script that registers the service worker should be injected into the bottom of the HTML page.",
          "type": "boolean",
          "default": true
        },
        "registerWebmanifest": {
          "description": "Determines if a meta tag that points to the web manifest should be inserted at the end of the head element.",
          "type": "boolean",
          "default": true
        },
        "routesToPreCache": {
          "description": "A comma separated list of routes to pre-cache when service worker installs in the browser.",
          "type": "string",
          "default": ""
        },
        "strategy": {
          "description": "Selects one of the predefined service worker types.",
          "enum": ["cacheFirst", "cacheFirstSafe", "minimal", "networkFirst"],
          "default": "cacheFirstSafe"
        }
      }
    },
    "ElmahIo": {
      "properties": {
        "ApiKey": {
          "description": "An elmah.io API key with the Messages | Write permission.",
          "type": "string",
          "pattern": "^([0-9a-f]{32})|(#\\{.*\\}#?)$"
        },
        "LogId": {
          "description": "The Id of the elmah.io log to store messages in.",
          "type": "string",
          "pattern": "^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})|(#\\{.*\\}#?)$"
        },
        "Application": {
          "description": "An application name to put on all error messages.",
          "type": "string"
        },
        "HandledStatusCodesToLog": {
          "description": "A list of HTTP status codes (besides 404) to log even though no exception is thrown.",
          "type": "array",
          "items": {
            "type": "integer"
          }
        },
        "TreatLoggingAsBreadcrumbs": {
          "description": "Include log messages from Microsoft.Extensions.Logging as breadcrumbs.",
          "type": "boolean"
        },
        "HeartbeatId": {
          "description": "The Id of the elmah.io heartbeat to notify.",
          "type": "string",
          "pattern": "^([0-9a-f]{32})|(#\\{.*\\}#?)$"
        }
      },
      "required": ["ApiKey", "LogId"]
    },
    "protocols": {
      "description": "The protocols enabled on the endpoint.",
      "type": "string",
      "enum": [
        "None",
        "Http1",
        "Http2",
        "Http1AndHttp2",
        "Http3",
        "Http1AndHttp2AndHttp3"
      ]
    },
    "certificate": {
      "title": "certificate",
      "description": "Certificate configuration.",
      "type": "object",
      "properties": {
        "Path": {
          "description": "The certificate file path. If a file path is specified then the certificate will be loaded from the file system.",
          "type": "string"
        },
        "KeyPath": {
          "description": "The certificate key file path. Available in .NET 5 and later.",
          "type": "string"
        },
        "Password": {
          "description": "The certificate password used to access the private key.",
          "type": "string"
        },
        "Subject": {
          "description": "The certificate subject. If a subject is specified then the certificate will be loaded from the certificate store.",
          "type": "string"
        },
        "Store": {
          "description": "The certificate store name. Defaults to 'My'.",
          "type": "string",
          "default": "My"
        },
        "Location": {
          "description": "The certificate store location. Defaults to 'CurrentUser'.",
          "type": "string",
          "enum": ["LocalMachine", "CurrentUser"],
          "default": "CurrentUser"
        },
        "AllowInvalid": {
          "description": "A value indicating whether or not to load certificates that are considered invalid. Defaults to false.",
          "type": "boolean",
          "default": false
        }
      }
    },
    "sslProtocols": {
      "description": "Specifies allowable SSL protocols. Defaults to 'None' which allows the operating system to choose the best protocol to use, and to block protocols that are not secure. Unless your app has a specific reason not to, you should use this default. Available in .NET 5 and later.",
      "type": "array",
      "items": {
        "type": "string",
        "enum": ["None", "Tls", "Tls11", "Tls12", "Tls13"],
        "default": "None"
      }
    },
    "clientCertificateMode": {
      "description": "Specifies the client certificate requirements for a HTTPS connection. Defaults to 'NoCertificate'. Available in .NET 5 and later.",
      "type": "string",
      "enum": ["NoCertificate", "AllowCertificate", "RequireCertificate"],
      "default": "NoCertificate"
    },
    "kestrel": {
      "title": "kestrel",
      "type": "object",
      "description": "ASP.NET Core Kestrel server configuration.",
      "properties": {
        "Endpoints": {
          "title": "endpoints",
          "description": "Endpoints that Kestrel listens to for network requests. Each endpoint has a name specified by its JSON property name.",
          "type": "object",
          "additionalProperties": {
            "title": "endpoint options",
            "description": "Kestrel endpoint configuration.",
            "type": "object",
            "properties": {
              "Url": {
                "description": "The scheme, host name, and port the endpoint will listen on. A Url is required.",
                "type": "string",
                "format": "uri"
              },
              "Protocols": {
                "$ref": "#/definitions/protocols"
              },
              "SslProtocols": {
                "$ref": "#/definitions/sslProtocols"
              },
              "Certificate": {
                "$ref": "#/definitions/certificate"
              },
              "ClientCertificateMode": {
                "$ref": "#/definitions/clientCertificateMode"
              },
              "Sni": {
                "title": "SNI",
                "description": "Server Name Indication (SNI) configuration. This enables the mapping of client requested host names to certificates and other TLS settings. Wildcard names prefixed with '*.', as well as a top level '*' are supported. Available in .NET 5 and later.",
                "type": "object",
                "additionalProperties": {
                  "title": "SNI options",
                  "description": "Endpoint SNI configuration.",
                  "type": "object",
                  "properties": {
                    "Protocols": {
                      "$ref": "#/definitions/protocols"
                    },
                    "SslProtocols": {
                      "$ref": "#/definitions/sslProtocols"
                    },
                    "Certificate": {
                      "$ref": "#/definitions/certificate"
                    },
                    "ClientCertificateMode": {
                      "$ref": "#/definitions/clientCertificateMode"
                    }
                  }
                }
              }
            },
            "required": ["Url"]
          }
        },
        "EndpointDefaults": {
          "title": "endpoint defaults",
          "description": "Default configuration applied to all endpoints. Named endpoint specific configuration overrides defaults.",
          "type": "object",
          "properties": {
            "Protocols": {
              "$ref": "#/definitions/protocols"
            },
            "SslProtocols": {
              "$ref": "#/definitions/sslProtocols"
            },
            "ClientCertificateMode": {
              "$ref": "#/definitions/clientCertificateMode"
            }
          }
        },
        "Certificates": {
          "title": "certificates",
          "description": "Certificates that Kestrel uses with HTTPS endpoints. Each certificate has a name specified by its JSON property name. The 'Default' certificate is used by HTTPS endpoints that haven't specified a certificate.",
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/certificate"
          }
        }
      }
    },
    "logLevelThreshold": {
      "description": "Log level threshold.",
      "type": "string",
      "enum": [
        "Trace",
        "Debug",
        "Information",
        "Warning",
        "Error",
        "Critical",
        "None"
      ]
    },
    "logLevel": {
      "title": "logging level options",
      "description": "Log level configurations used when creating logs. Only logs that exceeds its matching log level will be enabled. Each log level configuration has a category specified by its JSON property name. For more information about configuring log levels, see https://docs.microsoft.com/aspnet/core/fundamentals/logging/#configure-logging.",
      "type": "object",
      "additionalProperties": {
        "$ref": "#/definitions/logLevelThreshold"
      }
    },
    "logging": {
      "title": "logging options",
      "type": "object",
      "description": "Configuration for Microsoft.Extensions.Logging.",
      "properties": {
        "LogLevel": {
          "$ref": "#/definitions/logLevel"
        },
        "Console": {
          "properties": {
            "LogLevel": {
              "$ref": "#/definitions/logLevel"
            },
            "FormatterName": {
              "description": "Name of the log message formatter to use. Defaults to 'simple'.",
              "type": "string",
              "default": "simple"
            },
            "FormatterOptions": {
              "title": "formatter options",
              "description": "Log message formatter options. Additional properties are available on the options depending on the configured formatter. The formatter is specified by FormatterName.",
              "type": "object",
              "properties": {
                "IncludeScopes": {
                  "description": "Include scopes when true. Defaults to false.",
                  "type": "boolean",
                  "default": false
                },
                "TimestampFormat": {
                  "description": "Format string used to format timestamp in logging messages. Defaults to null.",
                  "type": "string"
                },
                "UseUtcTimestamp": {
                  "description": "Indication whether or not UTC timezone should be used to for timestamps in logging messages. Defaults to false.",
                  "type": "boolean",
                  "default": false
                }
              }
            },
            "LogToStandardErrorThreshold": {
              "description": "The minimum level of messages are written to Console.Error.",
              "$ref": "#/definitions/logLevelThreshold"
            }
          }
        },
        "EventSource": {
          "properties": {
            "LogLevel": {
              "$ref": "#/definitions/logLevel"
            }
          }
        },
        "Debug": {
          "properties": {
            "LogLevel": {
              "$ref": "#/definitions/logLevel"
            }
          }
        },
        "EventLog": {
          "properties": {
            "LogLevel": {
              "$ref": "#/definitions/logLevel"
            }
          }
        },
        "ElmahIo": {
          "properties": {
            "LogLevel": {
              "$ref": "#/definitions/logLevel"
            }
          }
        },
        "ElmahIoBreadcrumbs": {
          "properties": {
            "LogLevel": {
              "$ref": "#/definitions/logLevel"
            }
          }
        }
      },
      "additionalProperties": {
        "title": "provider logging settings",
        "type": "object",
        "description": "Logging configuration for a provider. The provider name must match the configuration's JSON property property name.",
        "properties": {
          "LogLevel": {
            "$ref": "#/definitions/logLevel"
          }
        }
      }
    },
    "allowedHosts": {
      "description": "ASP.NET Core host filtering middleware configuration. Allowed hosts is a semicolon-delimited list of host names without port numbers. Requests without a matching host name will be refused. Host names may be prefixed with a '*.' wildcard, or use '*' to allow all hosts.",
      "type": "string"
    },
    "connectionStrings": {
      "title": "connection string options",
      "description": "Connection string configuration. Get connection strings with the IConfiguration.GetConnectionString(string) extension method.",
      "type": "object",
      "additionalProperties": {
        "description": "Connection string configuration. Each connection string has a name specified by its JSON property name.",
        "type": "string"
      }
    },
    "NLog": {
      "title": "NLog options",
      "type": "object",
      "description": "NLog configuration",
      "default": {},
      "properties": {
        "autoReload": {
          "type": "boolean",
          "description": "Automatically reload the NLog configuration when notified that appsettings.json file has changed.",
          "default": false
        },
        "throwConfigExceptions": {
          "type": ["boolean", "null"],
          "description": "Throws an exception when there is a config error? If not set, then throwExceptions will be used for this setting.",
          "default": false
        },
        "throwExceptions": {
          "type": "boolean",
          "description": "Throws an exception when there is an error. For unit testing only and advanced troubleshooting.",
          "default": false
        },
        "internalLogLevel": {
          "type": "string",
          "description": "The minimal log level for the internal logger.",
          "enum": ["Trace", "Debug", "Info", "Warn", "Error", "Fatal", "Off"],
          "default": "Off"
        },
        "internalLogFile": {
          "type": "string",
          "description": "Write internal log to the specified filepath"
        },
        "internalLogToConsole": {
          "type": "boolean",
          "description": "Write internal log to a console",
          "default": "false"
        },
        "internalLogToConsoleError": {
          "type": "boolean",
          "description": "Write internal log to a console with error stream",
          "default": "false"
        },
        "globalThreshold": {
          "type": "string",
          "description": "Log events below this threshold are not logged.",
          "enum": ["Trace", "Debug", "Info", "Warn", "Error", "Fatal", "Off"],
          "default": "Off"
        },
        "autoShutdown": {
          "type": "boolean",
          "description": "Automatically call `LogFactory.Shutdown` on AppDomain.Unload or AppDomain.ProcessExit",
          "default": "true"
        },
        "extensions": {
          "type": "array",
          "description": "Load NLog extension packages for additional targets and layouts",
          "default": [],
          "items": {
            "title": "extension",
            "type": "object",
            "description": "",
            "default": {},
            "properties": {
              "assembly": {
                "type": "string",
                "description": "Assembly Name of the NLog extension package."
              },
              "prefix": {
                "type": "string",
                "description": "Appends prefix to all type-names loaded from the assembly",
                "default": ""
              },
              "assemblyFile": {
                "type": "string",
                "description": "Absolute filepath to the Assembly-file of the NLog extension package.",
                "default": ""
              }
            }
          }
        },
        "variables": {
          "title": "variables",
          "type": "object",
          "description": "Key-value pair of variables",
          "propertyNames": {
            "pattern": "^[A-Za-z0-9_.-]+$"
          },
          "patternProperties": {
            ".*": {
              "type": ["number", "string", "boolean"]
            }
          }
        },
        "targetDefaultWrapper": {
          "title": "default wrapper",
          "type": "object",
          "description": "Wrap all defined targets with this custom target wrapper.",
          "default": {},
          "required": ["type"],
          "properties": {
            "type": {
              "type": "string",
              "description": ""
            }
          }
        },
        "targets": {
          "title": "targets",
          "type": "object",
          "description": "",
          "default": {},
          "properties": {
            "async": {
              "type": "boolean",
              "description": "Wrap all defined targets using AsyncWrapper with OverflowAction=Discard for better performance."
            }
          }
        },
        "rules": {
          "oneOf": [
            {
              "type": "array",
              "description": "",
              "default": [],
              "items": {
                "$ref": "#/definitions/NLogRulesItem"
              }
            },
            {
              "title": "rules",
              "type": "object",
              "propertyNames": {
                "pattern": "^[0-9]+$"
              },
              "patternProperties": {
                ".*": {
                  "$ref": "#/definitions/NLogRulesItem"
                }
              }
            }
          ]
        }
      }
    },
    "NLogRulesItem": {
      "title": "NLog rule item",
      "type": "object",
      "description": "Redirect LogEvents from matching Logger objects to specified targets",
      "default": {},
      "required": ["logger"],
      "properties": {
        "logger": {
          "type": "string",
          "description": "Match Logger objects based on their Logger-name. Can use wildcard characters ('*' or '?')."
        },
        "ruleName": {
          "type": "string",
          "description": "Rule identifier to allow rule lookup with Configuration.FindRuleByName and Configuration.RemoveRuleByName."
        },
        "level": {
          "anyOf": [
            {
              "type": "string",
              "description": "",
              "enum": ["Trace", "Debug", "Info", "Warn", "Error", "Fatal"]
            },
            {
              "type": "string"
            }
          ]
        },
        "levels": {
          "type": "string",
          "description": "Comma separated list of levels that this rule matches."
        },
        "minLevel": {
          "anyOf": [
            {
              "type": "string",
              "description": "",
              "enum": ["Trace", "Debug", "Info", "Warn", "Error", "Fatal"]
            },
            {
              "type": "string"
            }
          ]
        },
        "maxLevel": {
          "anyOf": [
            {
              "type": "string",
              "description": "",
              "enum": ["Trace", "Debug", "Info", "Warn", "Error", "Fatal"]
            },
            {
              "type": "string"
            }
          ]
        },
        "finalMinLevel": {
          "anyOf": [
            {
              "type": "string",
              "description": "",
              "enum": ["Trace", "Debug", "Info", "Warn", "Error", "Fatal"]
            },
            {
              "type": "string"
            }
          ]
        },
        "writeTo": {
          "type": "string",
          "description": "Name or names of a target - separated by comma. Remove this property for sending events to the blackhole."
        },
        "final": {
          "type": "boolean",
          "description": "Ignore further rules if this one matches.",
          "default": false
        },
        "enabled": {
          "type": "boolean",
          "description": "",
          "default": true
        },
        "filters": {
          "oneOf": [
            {
              "type": "array",
              "description": "",
              "default": [],
              "items": {
                "title": "filter",
                "type": "object",
                "description": "",
                "default": {},
                "required": ["type"],
                "properties": {
                  "type": {
                    "type": "string",
                    "description": ""
                  },
                  "action": {
                    "type": "string",
                    "description": "Result action when filter matches logevent.",
                    "enum": [
                      "Neutral",
                      "Log",
                      "Ignore",
                      "LogFinal",
                      "IgnoreFinal"
                    ],
                    "default": "Neutral"
                  }
                }
              }
            },
            {
              "title": "filter",
              "type": "object",
              "description": "",
              "default": {}
            }
          ]
        },
        "filterDefaultAction": {
          "type": "string",
          "description": "Default action if none of the filters match.",
          "enum": ["Neutral", "Log", "Ignore", "LogFinal", "IgnoreFinal"],
          "default": "Ignore"
        }
      }
    }
  },
  "id": "https://json.schemastore.org/appsettings.json",
  "patternProperties": {
    "^WebOptimizer$": {
      "$ref": "#/definitions/webOptimizer"
    },
    "^webOptimizer$": {
      "$ref": "#/definitions/webOptimizer"
    },
    "^weboptimizer$": {
      "$ref": "#/definitions/webOptimizer"
    },
    "^(cdn|Cdn)$": {
      "$ref": "#/definitions/cdn"
    },
    "^(pwa|PWA|Pwa)$": {
      "$ref": "#/definitions/pwa"
    },
    "^(ElmahIo|Elmahio|elmahIo|elmahio)$": {
      "$ref": "#/definitions/ElmahIo"
    },
    "^(nlog|Nlog|NLog)$": {
      "$ref": "#/definitions/NLog"
    }
  },
  "properties": {
    "Kestrel": {
      "$ref": "#/definitions/kestrel"
    },
    "Logging": {
      "$ref": "#/definitions/logging"
    },
    "AllowedHosts": {
      "$ref": "#/definitions/allowedHosts"
    },
    "ConnectionStrings": {
      "$ref": "#/definitions/connectionStrings"
    }
  },
  "title": "JSON schema ASP.NET Core's appsettings.json file",
  "type": "object"
}
