{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/simple-ai/json-schema/simple-ai-custom-data-query-request-schema.json",
  "title": "Custom Data Query Request",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/simple-ai-custom-data-api-openapi.yml#/components/schemas/CustomDataQueryRequest",
  "type": "object",
  "required": [
    "tableName"
  ],
  "properties": {
    "tableName": {
      "type": "string",
      "pattern": "^[a-z0-9_]+$",
      "title": "Table Name",
      "description": "The indexed custom data table to query."
    },
    "filters": {
      "type": "array",
      "title": "Filters",
      "description": "Exact-match filters. Each filter matches a column against one or more values (any-of). An empty filter is ignored.",
      "items": {
        "type": "object",
        "required": [
          "column",
          "values"
        ],
        "properties": {
          "column": {
            "type": "string",
            "pattern": "^[a-z0-9_]+$",
            "title": "Column"
          },
          "values": {
            "type": "array",
            "title": "Values",
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                }
              ]
            }
          }
        }
      }
    },
    "text": {
      "type": "string",
      "maxLength": 5000,
      "title": "Text",
      "description": "Optional free-text search across all columns."
    },
    "size": {
      "type": "integer",
      "minimum": 0,
      "maximum": 50,
      "title": "Size",
      "description": "Max records to return (default 25, max 50)."
    },
    "from": {
      "type": "integer",
      "minimum": 0,
      "title": "From",
      "description": "Offset for pagination."
    }
  }
}