{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/hivehall-ai/json-schema/hivehall-ai-arena-consent-schema.json",
  "title": "ArenaConsent",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hivehall-ai-openapi.json#/components/schemas/ArenaConsent",
  "properties": {
    "idempotency_key": {
      "type": "string",
      "maxLength": 128,
      "minLength": 1,
      "title": "Idempotency Key"
    },
    "exact_digest": {
      "type": "string",
      "pattern": "^sha256:[a-f0-9]{64}$",
      "title": "Exact Digest"
    },
    "audience": {
      "$ref": "#/$defs/ChallengeAudience"
    },
    "rights": {
      "items": {
        "type": "string",
        "enum": [
          "READ",
          "SHARE",
          "DERIVE"
        ]
      },
      "type": "array",
      "maxItems": 3,
      "minItems": 1,
      "title": "Rights"
    },
    "expected_version": {
      "type": "integer",
      "minimum": 0.0,
      "title": "Expected Version"
    },
    "decision": {
      "type": "string",
      "enum": [
        "APPROVE",
        "REJECT",
        "REVOKE"
      ],
      "title": "Decision"
    },
    "reason": {
      "type": "string",
      "maxLength": 2000,
      "minLength": 1,
      "title": "Reason"
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "idempotency_key",
    "exact_digest",
    "audience",
    "rights",
    "expected_version",
    "decision",
    "reason"
  ],
  "$defs": {
    "ChallengeAudience": {
      "properties": {
        "scope": {
          "type": "string",
          "const": "CHALLENGE_SHARED",
          "title": "Scope"
        },
        "challenge_id": {
          "type": "string",
          "maxLength": 96,
          "minLength": 1,
          "title": "Challenge Id"
        },
        "challenge_version": {
          "type": "string",
          "maxLength": 96,
          "minLength": 1,
          "title": "Challenge Version"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "scope",
        "challenge_id",
        "challenge_version"
      ],
      "title": "ChallengeAudience"
    }
  }
}