{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/ffizer-yaml/latest.json",
  "title": "TemplateCfg",
  "x-lintel": {
    "source": "https://ffizer.github.io/ffizer/ffizer.schema.json",
    "sourceSha256": "5770641bf0ac56d343e55fcd106913762bc8f55fd976de0579682a08b977b535",
    "fileMatch": [
      ".ffizer.yaml"
    ],
    "parsers": [
      "yaml"
    ]
  },
  "type": "object",
  "properties": {
    "ignores": {
      "description": "list of path from the current template to ignore",
      "type": "array",
      "default": [],
      "items": {
        "type": "string"
      }
    },
    "imports": {
      "description": "list of template to import and to apply as part of this template",
      "type": "array",
      "default": [],
      "items": {
        "$ref": "#/$defs/ImportCfg"
      }
    },
    "scripts": {
      "description": "list of the scripts to apply at end of generation",
      "type": "array",
      "default": [],
      "items": {
        "$ref": "#/$defs/ScriptCfg"
      }
    },
    "use_template_dir": {
      "description": "set to true if the template content is under a `template` folder (not mixed with metadata)",
      "type": "boolean",
      "default": false
    },
    "variables": {
      "description": "list of variables/parameters of the template",
      "type": "array",
      "default": [],
      "items": {
        "$ref": "#/$defs/VariableCfg"
      }
    }
  },
  "additionalProperties": false,
  "$defs": {
    "AnyValue": {
      "type": "boolean"
    },
    "ImportCfg": {
      "description": "define a template layer to import",
      "type": "object",
      "properties": {
        "rev": {
          "type": [
            "string",
            "null"
          ]
        },
        "subfolder": {
          "type": [
            "string",
            "null"
          ]
        },
        "uri": {
          "type": "string"
        }
      },
      "required": [
        "uri"
      ]
    },
    "LabelValueCfg": {
      "type": "object",
      "properties": {
        "label": {
          "description": "display of the value (in select)",
          "type": "string"
        },
        "value": {
          "description": "the value",
          "$ref": "#/$defs/AnyValue"
        }
      },
      "required": [
        "label",
        "value"
      ]
    },
    "ScriptCfg": {
      "type": "object",
      "properties": {
        "cmd": {
          "description": "command to execute",
          "type": [
            "string",
            "null"
          ]
        },
        "default_confirm_answer": {
          "description": "default answer for confirmation of execution",
          "type": [
            "string",
            "null"
          ]
        },
        "message": {
          "description": "message to display",
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "VariableCfg": {
      "type": "object",
      "properties": {
        "ask": {
          "description": "sentence to ask the value (default to the name on variable)",
          "type": [
            "string",
            "null"
          ]
        },
        "default_value": {
          "description": "optionnal default value",
          "anyOf": [
            {
              "$ref": "#/$defs/AnyValue"
            },
            {
              "type": "null"
            }
          ]
        },
        "hidden": {
          "description": "is the variable hidden to the user (could be usefull to cache shared variable/data)",
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "description": "name of variable used in the template",
          "type": "string"
        },
        "select_in_values": {
          "description": "if non-empty then the value should selected into the list of value",
          "anyOf": [
            {
              "$ref": "#/$defs/VariableValuesCfg"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "name"
      ]
    },
    "VariableValuesCfg": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/LabelValueCfg"
          }
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AnyValue"
          }
        },
        {
          "type": "string"
        }
      ]
    }
  }
}
