{
  "components": {
    "schemas": {
      "AirportRegion": {
        "description": "Represents an airport region",
        "format": "{airport|city}/<code>",
        "title": "AirportRegion",
        "type": "string"
      },
      "Available": {
        "properties": {
          "forecastOn": {
            "format": "date-time",
            "type": "string"
          },
          "outcome": {
            "const": "Available",
            "type": "string"
          },
          "priceTrend": {
            "$ref": "#/components/schemas/PriceTrend"
          },
          "series": {
            "$ref": "#/components/schemas/ForecastSeries"
          },
          "values": {
            "$ref": "#/components/schemas/ForecastValues"
          }
        },
        "required": [
          "forecastOn",
          "values",
          "series",
          "outcome"
        ],
        "title": "Available",
        "type": "object"
      },
      "Currency": {
        "description": "ISO 4217 3-letter currency code",
        "title": "Currency",
        "type": "string"
      },
      "ForecastError": {
        "properties": {
          "message": {
            "type": "string"
          }
        },
        "required": [
          "message"
        ],
        "title": "ForecastError",
        "type": "object"
      },
      "ForecastResponse": {
        "discriminator": {
          "mapping": {
            "Available": "#/components/schemas/Available",
            "Unavailable": "#/components/schemas/Unavailable"
          },
          "propertyName": "outcome"
        },
        "oneOf": [
          {
            "$ref": "#/components/schemas/Available"
          },
          {
            "$ref": "#/components/schemas/Unavailable"
          }
        ],
        "title": "ForecastResponse"
      },
      "ForecastSeries": {
        "properties": {
          "future": {
            "items": {
              "$ref": "#/components/schemas/FutureDate"
            },
            "type": "array"
          },
          "past": {
            "items": {
              "$ref": "#/components/schemas/PastDate"
            },
            "type": "array"
          }
        },
        "required": [
          "past",
          "future"
        ],
        "title": "ForecastSeries",
        "type": "object"
      },
      "ForecastValues": {
        "properties": {
          "dangerDate": {
            "format": "date",
            "type": "string"
          },
          "dangerPrice": {
            "type": "number"
          },
          "goodPrice": {
            "type": "number"
          },
          "targetPrice": {
            "type": "number"
          },
          "warningDate": {
            "format": "date",
            "type": "string"
          },
          "warningPrice": {
            "type": "number"
          }
        },
        "required": [
          "targetPrice",
          "goodPrice"
        ],
        "title": "ForecastValues",
        "type": "object"
      },
      "FutureDate": {
        "properties": {
          "date": {
            "format": "date",
            "type": "string"
          },
          "priceTarget90": {
            "type": "number"
          }
        },
        "required": [
          "date",
          "priceTarget90"
        ],
        "title": "FutureDate",
        "type": "object"
      },
      "PastDate": {
        "properties": {
          "date": {
            "format": "date",
            "type": "string"
          },
          "price": {
            "type": "number"
          },
          "shops": {
            "format": "int32",
            "type": "integer"
          }
        },
        "required": [
          "date",
          "price",
          "shops"
        ],
        "title": "PastDate",
        "type": "object"
      },
      "PriceTrend": {
        "properties": {
          "buyNeutralThreshold": {
            "description": "Threshold use to create the low buy confidence.",
            "format": "double",
            "type": "number"
          },
          "lowBuyConfidence": {
            "description": "Represent if this is a buy neutral recommendation.",
            "type": "boolean"
          },
          "lowWaitConfidence": {
            "description": "Represent if this is a wait neutral recommendation.",
            "type": "boolean"
          },
          "upwardsProbability": {
            "description": "Represent how likely the price will go up after forecast time. 0 = not likely, 1 = very likely.",
            "format": "double",
            "type": "number"
          },
          "waitNeutralThreshold": {
            "description": "Threshold use to create the low wait confidence.",
            "format": "double",
            "type": "number"
          }
        },
        "required": [
          "upwardsProbability"
        ],
        "title": "PriceTrend",
        "type": "object"
      },
      "TripFilter": {
        "enum": [
          "NoLowCostCarrier",
          "NonStop",
          "ShortLayover"
        ],
        "title": "TripFilter",
        "type": "string"
      },
      "Unavailable": {
        "properties": {
          "forecastOn": {
            "format": "date-time",
            "type": "string"
          },
          "outcome": {
            "const": "Unavailable",
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "reason",
          "forecastOn",
          "outcome"
        ],
        "title": "Unavailable",
        "type": "object"
      }
    }
  },
  "info": {
    "title": "Flight Price Prediction API",
    "version": "1.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/flights-price-prediction/v1/forecast": {
      "get": {
        "description": "Get a price forecast for a specific flight search",
        "operationId": "getFlights-price-predictionV1Forecast",
        "parameters": [
          {
            "in": "query",
            "name": "filters",
            "required": false,
            "schema": {
              "items": {
                "$ref": "#/components/schemas/TripFilter"
              },
              "type": "array"
            }
          },
          {
            "in": "query",
            "name": "origin",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/AirportRegion"
            }
          },
          {
            "in": "query",
            "name": "destination",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/AirportRegion"
            }
          },
          {
            "in": "query",
            "name": "departureDate",
            "required": true,
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "returnDate",
            "required": false,
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "forecastOn",
            "required": false,
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "currency",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Currency"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForecastResponse"
                }
              }
            },
            "description": "",
            "headers": {
              "Content-Type": {
                "required": true,
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Invalid value for: query parameter filters, Invalid value for: query parameter origin, Invalid value for: query parameter destination, Invalid value for: query parameter departureDate, Invalid value for: query parameter returnDate, Invalid value for: query parameter forecastOn, Invalid value for: query parameter currency"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForecastError"
                }
              }
            },
            "description": "",
            "headers": {
              "Content-Type": {
                "required": true,
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "summary": "Get price forecast for a specific flight search"
      }
    }
  },
  "servers": [
    {
      "url": "https://fintech.staging.htsapis.com",
      "description": "Staging"
    }
  ]
}
