{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/bookit-n-go/main/json-schema/bookit-n-go-hotel-search-schema.json",
  "title": "HotelSearch",
  "x-generated": "2026-10-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bookit-n-go-openapi.yaml#/components/schemas/HotelSearch",
  "type": "object",
  "required": [
    "destination",
    "checkIn",
    "checkOut",
    "rooms",
    "adults"
  ],
  "properties": {
    "destination": {
      "type": "string"
    },
    "checkIn": {
      "type": "string",
      "format": "date"
    },
    "checkOut": {
      "type": "string",
      "format": "date"
    },
    "rooms": {
      "type": "integer",
      "minimum": 1
    },
    "adults": {
      "type": "integer",
      "minimum": 1
    },
    "children": {
      "type": "integer",
      "minimum": 0,
      "default": 0
    },
    "currency": {
      "type": "string",
      "default": "CAD"
    },
    "nationality": {
      "type": "string",
      "default": "CA"
    },
    "occupancies": {
      "type": "array",
      "minItems": 1,
      "description": "Room-level occupancy. Preserve one item per room and provide one age for each child.",
      "items": {
        "type": "object",
        "required": [
          "adults",
          "children",
          "childAges"
        ],
        "properties": {
          "adults": {
            "type": "integer",
            "minimum": 1
          },
          "children": {
            "type": "integer",
            "minimum": 0
          },
          "childAges": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0,
              "maximum": 17
            }
          }
        }
      }
    }
  }
}