{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-policy/json-schema/microsoft-azure-policy-policy-definition-version-schema.json",
  "title": "PolicyDefinitionVersion",
  "description": "The ID of the policy definition version.",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-policy-openapi.yml#/components/schemas/PolicyDefinitionVersion",
  "type": "object",
  "properties": {
    "properties": {
      "$ref": "#/$defs/PolicyDefinitionVersionProperties"
    },
    "id": {
      "readOnly": true,
      "type": "string",
      "description": "The ID of the policy definition version."
    },
    "name": {
      "readOnly": true,
      "type": "string",
      "description": "The name of the policy definition version."
    },
    "type": {
      "readOnly": true,
      "type": "string",
      "description": "The type of the resource (Microsoft.Authorization/policyDefinitions/versions)."
    },
    "systemData": {
      "$ref": "#/$defs/systemData"
    }
  },
  "x-ms-azure-resource": true,
  "$defs": {
    "ParameterDefinitions": {
      "description": "The parameter definitions for parameters used in the policy. The keys are the parameter names.",
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/ParameterDefinitionsValue"
      }
    },
    "ParameterDefinitionsValue": {
      "type": "object",
      "properties": {
        "type": {
          "description": "The data type of the parameter.",
          "type": "string",
          "enum": [
            "String",
            "Array",
            "Object",
            "Boolean",
            "Integer",
            "Float",
            "DateTime"
          ],
          "x-ms-enum": {
            "name": "parameterType",
            "modelAsString": true
          }
        },
        "allowedValues": {
          "type": "array",
          "items": {
            "description": "The collection of allowed values for the parameter."
          },
          "x-ms-identifiers": [],
          "description": "The allowed values for the parameter."
        },
        "defaultValue": {
          "description": "The default value for the parameter if no value is provided."
        },
        "schema": {
          "type": "object",
          "description": "Provides validation of parameter inputs during assignment using a self-defined JSON schema. This property is only supported for object-type parameters and follows the Json.NET Schema 2019-09 implementation. You can learn more about using schemas at https://json-schema.org/ and test draft schemas at https://www.jsonschemavalidator.net/."
        },
        "metadata": {
          "type": "object",
          "properties": {
            "displayName": {
              "type": "string",
              "description": "The display name for the parameter."
            },
            "description": {
              "type": "string",
              "description": "The description of the parameter."
            },
            "strongType": {
              "type": "string",
              "description": "Used when assigning the policy definition through the portal. Provides a context aware list of values for the user to choose from."
            },
            "assignPermissions": {
              "type": "boolean",
              "description": "Set to true to have Azure portal create role assignments on the resource ID or resource scope value of this parameter during policy assignment. This property is useful in case you wish to assign permissions outside the assignment scope."
            }
          },
          "additionalProperties": {
            "type": "object"
          },
          "description": "General metadata for the parameter."
        }
      },
      "description": "The definition of a parameter that can be provided to the policy."
    },
    "PolicyDefinitionVersionProperties": {
      "type": "object",
      "properties": {
        "policyType": {
          "type": "string",
          "description": "The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom, and Static.",
          "enum": [
            "NotSpecified",
            "BuiltIn",
            "Custom",
            "Static"
          ],
          "x-ms-enum": {
            "name": "policyType",
            "modelAsString": true
          }
        },
        "mode": {
          "type": "string",
          "description": "The policy definition mode. Some examples are All, Indexed, Microsoft.KeyVault.Data.",
          "default": "Indexed"
        },
        "displayName": {
          "type": "string",
          "description": "The display name of the policy definition."
        },
        "description": {
          "type": "string",
          "description": "The policy definition description."
        },
        "policyRule": {
          "type": "object",
          "description": "The policy rule."
        },
        "metadata": {
          "type": "object",
          "description": "The policy definition metadata.  Metadata is an open ended object and is typically a collection of key value pairs."
        },
        "parameters": {
          "$ref": "#/$defs/ParameterDefinitions"
        },
        "version": {
          "type": "string",
          "description": "The policy definition version in #.#.# format."
        }
      },
      "description": "The policy definition properties."
    },
    "systemData": {
      "type": "object",
      "description": "Metadata pertaining to creation and last modification of the resource.",
      "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)"
        }
      },
      "readOnly": true
    }
  }
}