{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/yonyon-ai/json-schema/yonyon-ai-ask-descriptor-schema.json",
  "title": "AskDescriptor",
  "description": "Self-describing descriptor for the NLWeb query endpoint. Returned by GET /ask so an agent can learn how to call POST /ask without reading prose documentation.",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/yonyon-ai-openapi.yml#/components/schemas/AskDescriptor",
  "type": "object",
  "required": [
    "_meta",
    "answer",
    "method",
    "url",
    "streaming"
  ],
  "properties": {
    "@context": {
      "type": "string",
      "const": "https://schema.org",
      "description": "JSON-LD context."
    },
    "_meta": {
      "type": "object",
      "required": [
        "response_type",
        "version"
      ],
      "description": "NLWeb envelope metadata.",
      "properties": {
        "response_type": {
          "type": "string",
          "const": "nlws",
          "description": "Always 'nlws' for this endpoint."
        },
        "version": {
          "type": "string",
          "description": "NLWeb protocol version."
        }
      }
    },
    "query": {
      "type": "string",
      "description": "Always empty on the descriptor; present so the descriptor and a real answer share one shape."
    },
    "answer": {
      "type": "string",
      "description": "Human and agent readable instructions for calling this endpoint."
    },
    "results": {
      "type": "array",
      "description": "Always empty on the descriptor.",
      "items": {
        "type": "object",
        "properties": {
          "@type": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        }
      }
    },
    "method": {
      "type": "string",
      "enum": [
        "POST"
      ],
      "description": "HTTP method to use for a real query."
    },
    "url": {
      "type": "string",
      "format": "uri",
      "description": "Absolute URL to POST a query to."
    },
    "streaming": {
      "type": "boolean",
      "description": "Whether the endpoint can stream Server-Sent Events."
    }
  }
}