{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://tiffany.systems/api/schema/claim-index.schema.json",
  "title": "ClaimIndex",
  "description": "A list of claim identities. The scientific index and the fixture index share this shape so a client cannot be surprised by which one it is reading — the classification field is what distinguishes them.",
  "x-schema-version": "1.0.0",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema", "count", "claims"],
  "properties": {
    "schema": {"const": "tiffany.systems/schema/claim-index/1.0.0"},
    "classification": {"type": "string", "enum": ["PUBLIC", "PUBLIC_SANITIZED", "DEMO_FIXTURE"], "description": "Absent on the scientific index, which never contains fixtures. Present and equal to DEMO_FIXTURE on the fixture index."},
    "notice": {"type": "string"},
    "note": {"type": "string"},
    "count": {"type": "integer"},
    "claims": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["id"],
        "properties": {
          "id": {"type": "string", "pattern": "^claim/[a-z0-9]([a-z0-9-]*[a-z0-9])?$"},
          "url": {"type": "string"},
          "current_url": {"type": "string", "description": "Resolves to whatever the laboratory currently asserts. Not citable."},
          "current_version": {"type": "string", "pattern": "^v[0-9]+$"},
          "lifecycle": {"type": "string", "enum": ["CURRENT", "SUPERSEDED", "WITHDRAWN", "FALSIFIED", "HISTORICAL"]},
          "versions": {
            "type": "array",
            "items": {
              "type": "object", "additionalProperties": false, "required": ["version", "url", "digest", "lifecycle"],
              "properties": {
                "version": {"type": "string", "pattern": "^v[0-9]+$"},
                "url": {"type": "string", "description": "Permanent. This is the citable address."},
                "digest": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"},
                "lifecycle": {"type": "string", "enum": ["CURRENT", "SUPERSEDED", "WITHDRAWN", "FALSIFIED", "HISTORICAL"]}
              }
            }
          }
        }
      }
    }
  }
}
