{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/ringsaturn/xue/blob/main/docs/schemas/pointer.schema.json",
  "title": "ProductPointer",
  "description": "A point product's live pointer, latest-<product>.json: the one mutable object, naming an issue's immutable index by path, byte length and CRC32. Which directories the path may name is the product's own rule.",
  "type": "object",
  "required": ["schemaVersion", "product", "issued", "path", "byteLength", "crc32"],
  "properties": {
    "schemaVersion": {"type": "integer", "const": 1},
    "product": {"type": "string", "pattern": "^[a-z][a-z0-9]*$"},
    "issued": {"$ref": "#/$defs/Timestamp"},
    "path": {"type": "string", "pattern": "^[a-z][a-z0-9]*[./][A-Za-z0-9._/-]*/index\\.json$"},
    "byteLength": {"type": "integer", "minimum": 1},
    "crc32": {"type": "string", "pattern": "^[0-9a-f]{8}$"}
  },
  "$defs": {
    "Timestamp": {
      "description": "ISO 8601 UTC, to the second, with a Z suffix.",
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
      "format": "date-time"
    }
  }
}
