{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://canpuff.org/schemas/v1/tombstone.json",
  "title": "CanPUFF tombstone v1",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "minLength": 1
    },
    "version": {
      "type": "integer"
    },
    "id": {
      "$ref": "#/$defs/uuid"
    },
    "deleted": {
      "const": true
    },
    "updated": {
      "$ref": "#/$defs/timestamp"
    }
  },
  "required": [
    "type",
    "version",
    "id",
    "deleted",
    "updated"
  ],
  "additionalProperties": false,
  "$defs": {
    "uuid": {
      "type": "string",
      "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
    },
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2})$",
      "description": "RFC 3339 with UTC offset (Z acceptable)"
    }
  }
}
