{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openservicedirectory.org/schemas/registry-search-request/0.3.0.schema.json",
  "$comment": "JSON Schema representation of the ARD v0.91 SearchRequest in spec/schemas/ard.openapi.yaml at commit aa3e598bb7752a9175897823234311216acfa864.",
  "title": "ARD registry search request",
  "type": "object",
  "required": ["query"],
  "properties": {
    "query": { "$ref": "#/$defs/searchQuery" },
    "federation": { "type": "string", "enum": ["auto", "referrals", "none"], "default": "auto" },
    "pageSize": { "type": "integer", "default": 10, "description": "Maximum number of search results to return." },
    "pageToken": { "type": "string", "description": "Pagination token." }
  },
  "additionalProperties": false,
  "$defs": {
    "query": {
      "type": "object",
      "properties": {
        "@context": {
          "oneOf": [
            { "type": "string", "format": "uri" },
            { "type": "object" },
            { "type": "array" }
          ],
          "description": "Optional JSON-LD context for namespaced filter terms."
        },
        "text": { "type": "string", "description": "Natural language description that narrows the set by semantic relevance." },
        "filter": {
          "type": "object",
          "description": "Structured constraints whose keys are field paths and whose values are strings or arrays of strings.",
          "additionalProperties": {
            "oneOf": [
              { "type": "string" },
              { "type": "array", "items": { "type": "string" } }
            ]
          }
        }
      },
      "additionalProperties": false
    },
    "searchQuery": {
      "allOf": [
        { "$ref": "#/$defs/query" },
        { "type": "object", "required": ["text"] }
      ]
    }
  }
}
