﻿{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://playbrightgaming.com/agents/receipt.schema.json",
  "title": "PennyBot Reality Receipt v2",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "receiptVersion",
    "byteContract",
    "requestedUrl",
    "finalUrl",
    "status",
    "contentType",
    "contentEncoding",
    "byteLength",
    "sha256",
    "fetchedAt"
  ],
  "properties": {
    "receiptVersion": {
      "const": "pennybot.url-receipt.v2"
    },
    "byteContract": {
      "const": "raw-content-encoded-body"
    },
    "requestedUrl": {
      "type": "string",
      "format": "uri"
    },
    "finalUrl": {
      "type": "string",
      "format": "uri"
    },
    "status": {
      "type": "integer",
      "minimum": 200,
      "maximum": 599
    },
    "contentType": {
      "type": [
        "string",
        "null"
      ]
    },
    "contentEncoding": {
      "type": "string"
    },
    "byteLength": {
      "type": "integer",
      "minimum": 0,
      "maximum": 1000000
    },
    "sha256": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "fetchedAt": {
      "type": "string",
      "format": "date-time"
    }
  }
}
