{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "git-tpl user configuration",
  "description": "The personal git-tpl/config.toml contract. Defaults seed interactive prompts only; they are not template-specific answer validation.",
  "type": "object",
  "properties": {
    "defaults": {
      "description": "Prompt defaults, keyed by question name.\n\nA seed and never an answer. See [`UserConfig`]'s module documentation\nand `docs/architecture/adr/013-user-configuration.md`.",
      "type": "object",
      "additionalProperties": {
        "$ref": "#/definitions/Value"
      },
      "default": {}
    },
    "shortcuts": {
      "allOf": [
        {
          "description": "URL prefixes, keyed by the name written before the `:`.",
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "default": {}
        },
        {
          "propertyNames": {
            "minLength": 1,
            "not": {
              "anyOf": [
                {
                  "pattern": "/"
                },
                {
                  "anyOf": [
                    {
                      "pattern": "^[hH][tT][tT][pP][sS]$"
                    },
                    {
                      "pattern": "^[hH][tT][tT][pP]$"
                    },
                    {
                      "pattern": "^[sS][sS][hH]$"
                    },
                    {
                      "pattern": "^[gG][iI][tT]$"
                    },
                    {
                      "pattern": "^[fF][iI][lL][eE]$"
                    }
                  ]
                }
              ]
            }
          }
        }
      ]
    },
    "trust": {
      "description": "Templates whose declared capabilities are authorised without a prompt.",
      "default": {
        "templates": []
      },
      "allOf": [
        {
          "$ref": "#/definitions/Trust"
        }
      ]
    }
  },
  "additionalProperties": false,
  "definitions": {
    "Value": {
      "description": "A structured value.\n\n`BTreeMap` for tables so that iteration order is deterministic. A template\nthat iterates a table must render the same bytes every time, or the rendered\ntree changes for no reason and `update` commits noise.",
      "anyOf": [
        {
          "description": "An explicitly present null, distinct from a missing context name.",
          "type": "null"
        },
        {
          "description": "A boolean.",
          "type": "boolean"
        },
        {
          "description": "A 64-bit signed integer.",
          "type": "integer",
          "format": "int64"
        },
        {
          "description": "A double-precision float.",
          "type": "number",
          "format": "double"
        },
        {
          "description": "A UTF-8 string.",
          "type": "string"
        },
        {
          "description": "An ordered list.",
          "type": "array",
          "items": {
            "$ref": "#/definitions/Value"
          }
        },
        {
          "description": "A key-value table, iterated in key order.",
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/Value"
          }
        }
      ]
    },
    "Trust": {
      "description": "The `[trust]` table.",
      "type": "object",
      "properties": {
        "templates": {
          "description": "Glob patterns matched against the normalised template URL.",
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "$id": "https://noirbizarre.github.io/git-tpl/user.schema.json"
}
