{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sabre/json-schema/sabre-hotel-search-request-schema.json",
  "title": "HotelSearchRequest",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sabre-hotel-search-api-openapi.yml#/components/schemas/HotelSearchRequest",
  "type": "object",
  "required": [
    "CheckIn",
    "CheckOut",
    "GeoSearch"
  ],
  "properties": {
    "CheckIn": {
      "type": "string",
      "format": "date"
    },
    "CheckOut": {
      "type": "string",
      "format": "date"
    },
    "GeoSearch": {
      "oneOf": [
        {
          "$ref": "#/$defs/AirportSearch"
        },
        {
          "$ref": "#/$defs/CitySearch"
        },
        {
          "$ref": "#/$defs/GeoCodeSearch"
        }
      ]
    },
    "Guests": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "Adults": {
            "type": "integer",
            "minimum": 1,
            "default": 1
          }
        }
      }
    },
    "MaxResults": {
      "type": "integer",
      "default": 20,
      "maximum": 100
    },
    "SortBy": {
      "type": "string",
      "enum": [
        "PRICE_LOWEST",
        "PRICE_HIGHEST",
        "STAR_RATING",
        "DISTANCE"
      ]
    }
  },
  "$defs": {
    "AirportSearch": {
      "type": "object",
      "required": [
        "AirportCode"
      ],
      "properties": {
        "AirportCode": {
          "type": "string"
        },
        "RadiusMiles": {
          "type": "integer",
          "default": 5
        }
      }
    },
    "CitySearch": {
      "type": "object",
      "required": [
        "CityCode"
      ],
      "properties": {
        "CityCode": {
          "type": "string"
        },
        "RadiusMiles": {
          "type": "integer",
          "default": 5
        }
      }
    },
    "GeoCodeSearch": {
      "type": "object",
      "required": [
        "Latitude",
        "Longitude"
      ],
      "properties": {
        "Latitude": {
          "type": "number",
          "format": "double"
        },
        "Longitude": {
          "type": "number",
          "format": "double"
        },
        "RadiusMiles": {
          "type": "integer",
          "default": 5
        }
      }
    }
  }
}