{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.snowplow.io/schemas/snowplow/data-structure.json",
  "title": "Snowplow Data Structure",
  "description": "Schema for Snowplow data structure (event schema) management objects returned by the Console API",
  "type": "object",
  "properties": {
    "hash": {
      "type": "string",
      "description": "SHA-256 hash identifier of the data structure (derived from vendor, name, format)"
    },
    "vendor": {
      "type": "string",
      "description": "Schema vendor namespace in reverse DNS notation (e.g., com.example)"
    },
    "name": {
      "type": "string",
      "description": "Schema name in snake_case (e.g., page_view, add_to_cart)"
    },
    "format": {
      "type": "string",
      "enum": ["jsonschema"],
      "description": "Schema format type"
    },
    "latestVersion": {
      "type": "string",
      "pattern": "^[0-9]+-[0-9]+-[0-9]+$",
      "description": "Latest version in SchemaVer format (major-minor-patch)"
    },
    "deployments": {
      "type": "array",
      "description": "Current deployment state across environments",
      "items": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "pattern": "^[0-9]+-[0-9]+-[0-9]+$"
          },
          "environment": {
            "type": "string",
            "enum": ["VALIDATED", "DEV", "PROD"]
          },
          "deployedAt": {
            "type": "string",
            "format": "date-time"
          },
          "deployedBy": {
            "type": "string"
          }
        }
      }
    },
    "meta": {
      "type": "object",
      "description": "Metadata for the data structure",
      "properties": {
        "description": {
          "type": "string"
        },
        "owner": {
          "type": "string"
        },
        "customData": {
          "type": "object"
        }
      }
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": ["hash", "vendor", "name", "format"]
}
