{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://aiwg.io/schemas/testing/custom-template.v1.schema.json",
  "title": "Test Normalization Template v1",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "apiVersion",
    "kind",
    "metadata",
    "spec"
  ],
  "properties": {
    "apiVersion": {
      "const": "testing.aiwg.io/v1"
    },
    "kind": {
      "const": "TestNormalizationTemplate"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "createdAt",
        "toolVersion"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "createdAt": {
          "type": "string",
          "minLength": 1
        },
        "toolVersion": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "spec": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "platform",
        "description",
        "variables",
        "files"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9:._-]*$"
        },
        "platform": {
          "type": "string",
          "minLength": 1
        },
        "description": {
          "type": "string",
          "minLength": 1
        },
        "variables": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "name",
              "type",
              "required"
            ],
            "properties": {
              "name": {
                "type": "string",
                "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
              },
              "type": {
                "enum": [
                  "string",
                  "number",
                  "boolean",
                  "path"
                ]
              },
              "required": {
                "type": "boolean"
              },
              "default": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "number"
                  },
                  {
                    "type": "boolean"
                  }
                ]
              }
            }
          }
        },
        "files": {
          "type": "array",
          "minItems": 1,
          "maxItems": 1000,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "path",
              "content"
            ],
            "properties": {
              "path": {
                "type": "string",
                "minLength": 1
              },
              "content": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}
