{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-purview/json-schema/microsoft-purview-classification-rule-schema.json",
  "title": "ClassificationRule",
  "description": "A classification rule definition",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-purview-classification-rules-api-openapi.yml#/components/schemas/ClassificationRule",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "readOnly": true
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "enum": [
        "Custom",
        "System"
      ]
    },
    "properties": {
      "type": "object",
      "properties": {
        "description": {
          "type": "string"
        },
        "classificationName": {
          "type": "string"
        },
        "ruleStatus": {
          "type": "string",
          "enum": [
            "Enabled",
            "Disabled"
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "lastModifiedAt": {
          "type": "string",
          "format": "date-time"
        },
        "version": {
          "type": "integer",
          "format": "int32"
        },
        "dataPatterns": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ClassificationRulePattern"
          }
        },
        "columnPatterns": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ClassificationRulePattern"
          }
        }
      }
    }
  },
  "$defs": {
    "ClassificationRulePattern": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "Regex"
          ]
        },
        "pattern": {
          "type": "string"
        }
      }
    }
  }
}