{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/amadeus/refs/heads/main/json-schema/flight-offers-search-flight-filters-schema.json",
  "title": "FlightFilters",
  "description": "FlightFilters schema from Flight Offers Search",
  "type": "object",
  "properties": {
    "crossBorderAllowed": {
      "description": "Allows to search a location outside the borders when a radius around a location is specified. Default is false.",
      "type": "boolean",
      "example": false
    },
    "moreOvernightsAllowed": {
      "description": "This flag enables/disables the possibility to have more overnight flights in Low Fare Search",
      "type": "boolean",
      "example": false
    },
    "returnToDepartureAirport": {
      "description": "This option force to retrieve flight-offer with a departure and a return in the same airport",
      "type": "boolean",
      "example": false
    },
    "railSegmentAllowed": {
      "description": "This flag enable/disable filtering of rail segment (TGV AIR, RAIL ...)",
      "type": "boolean",
      "example": true
    },
    "busSegmentAllowed": {
      "description": "This flag enable/disable filtering of bus segment",
      "type": "boolean",
      "example": true
    },
    "maxFlightTime": {
      "description": "Maximum flight time as a percentage relative to the shortest flight time available for the itinerary",
      "type": "number",
      "example": 200
    },
    "carrierRestrictions": {
      "description": "Restriction towards carriers.",
      "type": "object",
      "properties": {
        "blacklistedInEUAllowed": {
          "description": "This flag enable/disable filtering of blacklisted airline by EU. The list of the banned airlines is published in the Official Journal of the European Union, where they are included as annexes A and B to the Commission Regulation. The blacklist of an airline can concern all its flights or some specific aircraft types pertaining to the airline",
          "type": "boolean",
          "default": false,
          "example": true
        },
        "excludedCarrierCodes": {
          "description": "This option ensures that the system will only consider these airlines.",
          "type": "array",
          "minItems": 1,
          "maxItems": 99,
          "items": {
            "type": "string"
          }
        },
        "includedCarrierCodes": {
          "description": "This option ensures that the system will only consider these airlines.",
          "type": "array",
          "minItems": 1,
          "maxItems": 99,
          "items": {
            "type": "string"
          }
        }
      }
    },
    "cabinRestrictions": {
      "title": "CabinRestrictions",
      "description": "Restriction towards cabins.",
      "type": "array",
      "minItems": 1,
      "maxItems": 6,
      "items": {
        "allOf": [
          {
            "title": "CabinRestriction",
            "type": "object",
            "properties": {
              "cabin": {
                "$ref": "#/definitions/TravelClass"
              },
              "originDestinationIds": {
                "title": "originDestinationIds",
                "description": "The list of originDestination identifiers for which the cabinRestriction applies",
                "type": "array",
                "items": {
                  "type": "string"
                },
                "example": [
                  1,
                  2
                ]
              }
            }
          },
          {
            "type": "object",
            "properties": {
              "coverage": {
                "$ref": "#/definitions/Coverage"
              }
            }
          }
        ]
      }
    },
    "connectionRestriction": {
      "description": "Restriction towards number of connections.",
      "type": "object",
      "properties": {
        "maxNumberOfConnections": {
          "description": "The maximal number of connections for each itinerary. Value can be 0, 1 or 2.",
          "type": "number",
          "example": 2
        },
        "nonStopPreferred": {
          "description": "When this option is requested, recommendations made of Non-Stop flights only are favoured by the search, on the whole itinerary, with a weight of 75%.",
          "type": "boolean",
          "example": false
        },
        "airportChangeAllowed": {
          "description": "Allow to change airport during connection",
          "type": "boolean",
          "example": false
        },
        "technicalStopsAllowed": {
          "description": "This option allows the single segment to have one or more intermediate stops (technical stops).",
          "type": "boolean",
          "example": true
        }
      }
    }
  }
}