{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure/json-schema/microsoft-azure-template-spec-version-schema.json",
  "title": "TemplateSpecVersion",
  "description": "Template Spec Version object.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-template-spec-versions-api-openapi.yml#/components/schemas/TemplateSpecVersion",
  "required": [
    "properties",
    "location"
  ],
  "type": "object",
  "allOf": [
    {
      "$ref": "#/$defs/AzureResourceBase"
    }
  ],
  "properties": {
    "location": {
      "type": "string",
      "x-ms-mutability": [
        "read",
        "create"
      ],
      "description": "The location of the Template Spec Version. It must match the location of the parent Template Spec."
    },
    "properties": {
      "description": "Template Spec Version properties.",
      "x-ms-client-flatten": true,
      "$ref": "#/$defs/TemplateSpecVersionProperties"
    },
    "tags": {
      "type": "object",
      "description": "Resource tags.",
      "additionalProperties": {
        "type": "string"
      }
    }
  },
  "$defs": {
    "AzureResourceBase": {
      "x-ms-azure-resource": true,
      "type": "object",
      "description": "Common properties for all Azure resources.",
      "properties": {
        "id": {
          "readOnly": true,
          "type": "string",
          "description": "String Id used to locate any resource on Azure."
        },
        "name": {
          "readOnly": true,
          "type": "string",
          "description": "Name of this resource."
        },
        "type": {
          "readOnly": true,
          "type": "string",
          "description": "Type of this resource."
        },
        "systemData": {
          "readOnly": true,
          "type": "object",
          "description": "Azure Resource Manager metadata containing createdBy and modifiedBy information.",
          "$ref": "#/$defs/systemData"
        }
      }
    },
    "LinkedTemplateArtifact": {
      "type": "object",
      "description": "Represents a Template Spec artifact containing an embedded Azure Resource Manager template for use as a linked template.",
      "properties": {
        "path": {
          "type": "string",
          "description": "A filesystem safe relative path of the artifact."
        },
        "template": {
          "type": "object",
          "description": "The Azure Resource Manager template."
        }
      },
      "required": [
        "template",
        "path"
      ]
    },
    "TemplateSpecVersionProperties": {
      "type": "object",
      "description": "Template Spec Version properties.",
      "properties": {
        "description": {
          "type": "string",
          "maxLength": 4096,
          "description": "Template Spec version description."
        },
        "linkedTemplates": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/LinkedTemplateArtifact"
          },
          "description": "An array of linked template artifacts.",
          "x-ms-identifiers": [
            "path"
          ]
        },
        "metadata": {
          "type": "object",
          "description": "The version metadata. Metadata is an open-ended object and is typically a collection of key-value pairs."
        },
        "mainTemplate": {
          "type": "object",
          "description": "The main Azure Resource Manager template content."
        },
        "uiFormDefinition": {
          "type": "object",
          "description": "The Azure Resource Manager template UI definition content."
        }
      }
    },
    "systemData": {
      "description": "Metadata pertaining to creation and last modification of the resource.",
      "type": "object",
      "readOnly": true,
      "properties": {
        "createdBy": {
          "type": "string",
          "description": "The identity that created the resource."
        },
        "createdByType": {
          "type": "string",
          "description": "The type of identity that created the resource.",
          "enum": [
            "User",
            "Application",
            "ManagedIdentity",
            "Key"
          ],
          "x-ms-enum": {
            "name": "createdByType",
            "modelAsString": true
          }
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "description": "The timestamp of resource creation (UTC)."
        },
        "lastModifiedBy": {
          "type": "string",
          "description": "The identity that last modified the resource."
        },
        "lastModifiedByType": {
          "type": "string",
          "description": "The type of identity that last modified the resource.",
          "enum": [
            "User",
            "Application",
            "ManagedIdentity",
            "Key"
          ],
          "x-ms-enum": {
            "name": "createdByType",
            "modelAsString": true
          }
        },
        "lastModifiedAt": {
          "type": "string",
          "format": "date-time",
          "description": "The timestamp of resource last modification (UTC)"
        }
      }
    }
  }
}