{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$defs": {},
  "operationId": "blocks.findText",
  "schemas": {
    "input": {
      "type": "object",
      "properties": {
        "text": {
          "type": "string",
          "pattern": "\\S",
          "description": "Literal case-insensitive substring. Whitespace is preserved."
        },
        "limit": {
          "type": "integer",
          "minimum": 0,
          "description": "Maximum matches. Default: 8; zero returns counts only."
        }
      },
      "additionalProperties": false,
      "required": [
        "text"
      ]
    },
    "output": {
      "type": "object",
      "properties": {
        "total": {
          "type": "integer",
          "minimum": 0
        },
        "matches": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "ordinal": {
                "type": "integer",
                "minimum": 0,
                "description": "Zero-based top-level body ordinal."
              },
              "nodeId": {
                "type": "string"
              },
              "nodeType": {
                "enum": [
                  "paragraph",
                  "heading",
                  "listItem",
                  "table",
                  "tableRow",
                  "tableCell",
                  "tableOfContents",
                  "image",
                  "sdt"
                ]
              },
              "preview": {
                "type": "string",
                "maxLength": 100
              }
            },
            "additionalProperties": false,
            "required": [
              "ordinal",
              "nodeId",
              "nodeType",
              "preview"
            ]
          }
        },
        "firstMatchOrdinal": {
          "type": "integer",
          "minimum": 0
        },
        "scanError": {
          "type": "object",
          "properties": {
            "message": {
              "type": "string"
            }
          },
          "additionalProperties": false,
          "required": [
            "message"
          ]
        },
        "scannedBlocks": {
          "type": "integer",
          "minimum": 0,
          "maximum": 20000
        },
        "truncated": {
          "type": "boolean"
        },
        "revision": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "total",
        "matches",
        "scannedBlocks",
        "truncated",
        "revision"
      ]
    }
  }
}
