{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/jenriks-com/json-schema/jenriks-com-nlweb-request-schema.json",
  "title": "NlwebRequest",
  "description": "NLWeb 0.55 structured body; the flat legacy fields (query as a string, site, prev, streaming, mode, max_results) are accepted as well.",
  "x-generated": "2026-11-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/jenriks-com-openapi.json#/components/schemas/NlwebRequest",
  "type": "object",
  "required": [
    "query"
  ],
  "properties": {
    "query": {
      "oneOf": [
        {
          "type": "string",
          "maxLength": 200
        },
        {
          "type": "object",
          "required": [
            "text"
          ],
          "properties": {
            "text": {
              "type": "string",
              "maxLength": 200
            },
            "site": {
              "type": "string"
            }
          }
        }
      ]
    },
    "context": {
      "type": "object",
      "properties": {
        "prev": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "prefer": {
      "type": "object",
      "properties": {
        "streaming": {
          "type": "boolean",
          "default": false
        },
        "mode": {
          "type": "string",
          "enum": [
            "list"
          ],
          "default": "list"
        },
        "response_format": {
          "type": "string",
          "enum": [
            "conversational_search"
          ]
        }
      }
    },
    "meta": {
      "type": "object",
      "properties": {
        "version": {
          "type": "string",
          "const": "0.55"
        }
      }
    },
    "site": {
      "type": "string"
    },
    "prev": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "streaming": {
      "type": "boolean"
    },
    "mode": {
      "type": "string",
      "enum": [
        "list"
      ]
    },
    "max_results": {
      "type": "integer",
      "minimum": 1,
      "maximum": 50,
      "default": 10
    }
  }
}