{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/smry-ai/json-schema/smry-ai-article-document-schema.json",
  "title": "ArticleDocument",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/smry-ai-public-openapi.json#/components/schemas/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
          }
        }
      }
    }
  }
}