{
  "$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-flight-search-schema.json",
  "title": "FlightSearch",
  "x-generated": "2026-10-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bookit-n-go-openapi.yaml#/components/schemas/FlightSearch",
  "type": "object",
  "required": [
    "origin",
    "destination",
    "departureDate",
    "tripType",
    "adults"
  ],
  "properties": {
    "origin": {
      "type": "string",
      "minLength": 3,
      "maxLength": 3
    },
    "destination": {
      "type": "string",
      "minLength": 3,
      "maxLength": 3
    },
    "departureDate": {
      "type": "string",
      "format": "date"
    },
    "returnDate": {
      "type": "string",
      "format": "date"
    },
    "tripType": {
      "type": "string",
      "enum": [
        "ONE_WAY",
        "ROUND_TRIP"
      ]
    },
    "adults": {
      "type": "integer",
      "minimum": 1
    },
    "children": {
      "type": "integer",
      "minimum": 0,
      "default": 0
    },
    "infants": {
      "type": "integer",
      "minimum": 0,
      "default": 0
    },
    "cabin": {
      "type": "string",
      "enum": [
        "ECONOMY",
        "PREMIUM_ECONOMY",
        "BUSINESS",
        "FIRST"
      ],
      "default": "ECONOMY"
    },
    "currency": {
      "type": "string",
      "default": "CAD"
    }
  }
}