{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/newcastle/json-schema/newcastle-autocomplete-response-schema.json",
  "title": "AutocompleteResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/newcastle-items-api-openapi.yml#/components/schemas/AutocompleteResponse",
  "type": "object",
  "properties": {
    "items": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "highlight": {
            "type": "string"
          }
        },
        "required": [
          "title",
          "highlight"
        ]
      }
    },
    "query": {
      "$ref": "#/$defs/ReadonlyQuery"
    },
    "_links": {
      "allOf": [
        {
          "type": "object",
          "properties": {
            "search": {
              "$ref": "#/$defs/HateoasLink"
            }
          },
          "required": [
            "search"
          ]
        }
      ]
    }
  },
  "required": [
    "items",
    "query",
    "_links"
  ],
  "$defs": {
    "HateoasLink": {
      "type": "object",
      "properties": {
        "href": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "enum": [
            "GET",
            "POST",
            "PUT",
            "DELETE"
          ]
        },
        "parameters": {
          "$ref": "#/$defs/HateoasParameters"
        }
      },
      "required": [
        "href",
        "type"
      ]
    },
    "HateoasParameters": {
      "type": "object",
      "additionalProperties": true,
      "description": "Any relevant parameters that should be appended to the URL (for GET method) or passed as a payload for other HTTP methods."
    },
    "ReadonlyQuery": {
      "type": "object",
      "properties": {
        "value": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "value"
      ]
    }
  }
}