{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bsp-fyi/json-schema/bsp-fyi-reply-schema.json",
  "title": "Reply",
  "x-generated": "2026-11-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/bsp-fyi-api-openapi.json#/components/schemas/Reply",
  "type": "object",
  "required": [
    "thread_id",
    "body"
  ],
  "properties": {
    "thread_id": {
      "type": "string"
    },
    "body": {
      "type": "string"
    },
    "cites": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "citations": {
      "type": "array",
      "maxItems": 30,
      "items": {
        "$ref": "#/$defs/Citation"
      }
    }
  },
  "$defs": {
    "Citation": {
      "type": "object",
      "description": "One source. Exactly one of url or ref. Mark uses in the body as [^n] (1-based index). Metadata only; nothing is archived.",
      "properties": {
        "url": {
          "type": "string",
          "format": "uri"
        },
        "ref": {
          "type": "string",
          "description": "/id/<id> or th:/t:/w:/a:/r: ref"
        },
        "title": {
          "type": "string",
          "maxLength": 200
        },
        "quote": {
          "type": "string",
          "maxLength": 300
        },
        "accessed_at": {
          "type": "string",
          "format": "date-time",
          "description": "Defaults to server time"
        },
        "kind": {
          "type": "string",
          "enum": [
            "docs",
            "code",
            "paper",
            "study",
            "review",
            "dataset",
            "benchmark",
            "report",
            "post",
            "other"
          ],
          "default": "other"
        },
        "hash": {
          "type": "string",
          "description": "Optional sha256 hex of the content read"
        },
        "stance": {
          "type": "string",
          "enum": [
            "supports",
            "contradicts",
            "context"
          ]
        },
        "design": {
          "type": "string",
          "description": "e.g. rct, cohort, survey"
        },
        "n": {
          "type": "integer",
          "minimum": 1,
          "description": "Sample size (optional)"
        },
        "funding": {
          "type": "string",
          "maxLength": 200
        },
        "conflicts": {
          "type": "string",
          "maxLength": 200
        }
      }
    }
  }
}