{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/Sharathvc23/forgetproof/main/schemas/forget-me/v1/evidence.schema.json",
  "title": "ForgetMe v1: Evidence",
  "description": "What GET {endpoint}/operations/{id}/evidence answers: one portable receipt per holder that produced one, each signed by its issuer (the host, or a recipient the host asked, re-served as received), and observations for rows that have no receipt (an unsupported recipient is the host's observation, never a receipt). `issuer_key_url` is where the host's own keys are published: its index.",
  "type": "object",
  "properties": {
    "operation": { "$ref": "common.schema.json#/$defs/operation-id" },
    "state": { "$ref": "common.schema.json#/$defs/state" },
    "issuer": { "type": "string", "minLength": 1, "maxLength": 200 },
    "issuer_key_url": { "type": "string", "minLength": 1, "maxLength": 2048 },
    "receipts": {
      "type": "array",
      "maxItems": 64,
      "items": {
        "type": "object",
        "properties": {
          "receipt_id": { "type": "string", "minLength": 1, "maxLength": 128 },
          "holder": { "$ref": "common.schema.json#/$defs/holder-name" },
          "party": { "$ref": "common.schema.json#/$defs/label" },
          "issuer": { "type": "string", "minLength": 1, "maxLength": 200 },
          "issuer_key_url": { "type": "string", "minLength": 1, "maxLength": 2048 },
          "fingerprint": { "$ref": "common.schema.json#/$defs/fingerprint" },
          "verified_by_host": { "description": "For a recipient's receipt: whether the host checked its signature against the keys the recipient publishes before re-serving it. The person's verifier checks again.", "type": "boolean" },
          "receipt": { "$ref": "receipt.schema.json" }
        },
        "required": ["receipt_id", "holder", "fingerprint", "receipt"]
      }
    },
    "observations": {
      "description": "Rows with no receipt: what the host itself observed about a holder it could not get evidence from.",
      "type": "array",
      "maxItems": 64,
      "items": {
        "type": "object",
        "properties": {
          "holder": { "$ref": "common.schema.json#/$defs/holder-name" },
          "party": { "$ref": "common.schema.json#/$defs/label" },
          "outcome": { "$ref": "common.schema.json#/$defs/outcome" },
          "observed_by": { "type": "string", "minLength": 1, "maxLength": 200 },
          "text": { "$ref": "common.schema.json#/$defs/text" },
          "at": { "$ref": "common.schema.json#/$defs/date-time" }
        },
        "required": ["holder", "outcome", "observed_by", "text", "at"]
      }
    },
    "reconciled": { "oneOf": [{ "$ref": "common.schema.json#/$defs/text" }, { "type": "null" }] },
    "note": { "$ref": "common.schema.json#/$defs/text" }
  },
  "required": ["operation", "state", "issuer", "issuer_key_url", "receipts"],
  "additionalProperties": true
}
