{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/smry-ai/json-schema/smry-ai-batch-read-response-schema.json",
  "title": "BatchReadResponse",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/smry-ai-public-openapi.json#/components/schemas/BatchReadResponse",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "count",
    "results"
  ],
  "properties": {
    "count": {
      "type": "integer",
      "minimum": 1,
      "maximum": 10
    },
    "results": {
      "type": "array",
      "minItems": 1,
      "maxItems": 10,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "index",
          "url",
          "status",
          "ok",
          "content_type",
          "output"
        ],
        "properties": {
          "index": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "status": {
            "type": "integer",
            "minimum": 200,
            "maximum": 599
          },
          "ok": {
            "type": "boolean"
          },
          "content_type": {
            "type": "string"
          },
          "output": {
            "oneOf": [
              {
                "$ref": "#/$defs/ArticleDocument"
              },
              {
                "$ref": "#/$defs/Problem"
              },
              {
                "type": "string"
              }
            ]
          }
        }
      }
    }
  },
  "$defs": {
    "ArticleDocument": {
      "type": "object",
      "required": [
        "source_url",
        "total_blocks",
        "total_tokens",
        "has_more",
        "next_cursor",
        "blocks"
      ],
      "properties": {
        "source_url": {
          "type": "string",
          "format": "uri"
        },
        "reader_url": {
          "type": "string",
          "format": "uri"
        },
        "title": {
          "type": [
            "string",
            "null"
          ]
        },
        "author": {
          "type": [
            "string",
            "null"
          ]
        },
        "publisher": {
          "type": [
            "string",
            "null"
          ]
        },
        "published_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "language": {
          "type": [
            "string",
            "null"
          ]
        },
        "total_blocks": {
          "type": "integer",
          "minimum": 0
        },
        "total_tokens": {
          "type": "integer",
          "minimum": 0
        },
        "has_more": {
          "type": "boolean",
          "description": "True when another page of article blocks is available."
        },
        "next_cursor": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^[1-9][0-9]*$",
          "description": "Pass this value as cursor on the next request; null marks the final page."
        },
        "blocks": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "anchor",
              "kind",
              "tokens",
              "text"
            ],
            "properties": {
              "anchor": {
                "type": "integer",
                "minimum": 1
              },
              "kind": {
                "type": "string",
                "enum": [
                  "heading",
                  "paragraph",
                  "reference"
                ]
              },
              "tokens": {
                "type": "integer",
                "minimum": 0
              },
              "text": {
                "type": "string"
              }
            }
          }
        },
        "query": {
          "type": "string"
        },
        "matched_blocks": {
          "type": "integer",
          "minimum": 0
        },
        "passages": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "anchor",
              "text",
              "section",
              "rank",
              "score",
              "tokens"
            ],
            "properties": {
              "anchor": {
                "type": "integer",
                "minimum": 1
              },
              "text": {
                "type": "string"
              },
              "section": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "rank": {
                "type": "integer",
                "minimum": 1
              },
              "score": {
                "type": "number",
                "minimum": 0
              },
              "tokens": {
                "type": "integer",
                "minimum": 0
              }
            }
          }
        }
      }
    },
    "Problem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "title",
        "status",
        "detail",
        "instance",
        "code",
        "resolution",
        "retryable"
      ],
      "properties": {
        "type": {
          "type": "string",
          "format": "uri-reference"
        },
        "title": {
          "type": "string"
        },
        "status": {
          "type": "integer",
          "minimum": 400,
          "maximum": 599
        },
        "detail": {
          "type": "string"
        },
        "instance": {
          "type": "string",
          "format": "uri"
        },
        "code": {
          "type": "string"
        },
        "resolution": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        }
      }
    }
  }
}