{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/dantelabs/main/json-schema/dantelabs-search-results-schema.json",
  "title": "SearchResults",
  "x-generated": "2026-10-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/dantelabs-api-openapi.json#/components/schemas/SearchResults",
  "type": "object",
  "required": [
    "query",
    "url",
    "best",
    "genes",
    "variants",
    "region"
  ],
  "properties": {
    "query": {
      "type": "string"
    },
    "url": {
      "type": "string",
      "format": "uri"
    },
    "best": {
      "description": "The one page the query names outright, if any.",
      "oneOf": [
        {
          "type": "null"
        },
        {
          "type": "object",
          "required": [
            "kind"
          ],
          "properties": {
            "kind": {
              "enum": [
                "gene",
                "variant"
              ]
            }
          }
        }
      ]
    },
    "genes": {
      "type": "object",
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SearchHit"
          }
        },
        "more": {
          "type": "boolean"
        }
      }
    },
    "variants": {
      "type": "object",
      "properties": {
        "total": {
          "type": "integer"
        },
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SearchHit"
          }
        }
      }
    },
    "region": {
      "description": "The genes around a position, when the query is one.",
      "type": [
        "object",
        "null"
      ]
    }
  },
  "$defs": {
    "SearchHit": {
      "type": "object",
      "required": [
        "url",
        "json"
      ],
      "properties": {
        "url": {
          "type": "string",
          "format": "uri"
        },
        "json": {
          "type": "string",
          "format": "uri",
          "description": "The hit's page as JSON."
        }
      }
    }
  }
}