{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/api-evangelist/amadeus/refs/heads/main/json-schema/flight-choice-prediction-segment-schema.json", "title": "Segment", "description": "Segment schema from Flight Choice Prediction", "allOf": [ { "type": "object", "properties": { "id": { "description": "Id of the segment", "type": "string", "example": 1 }, "numberOfStops": { "description": "Number of stops", "type": "integer", "example": 0 }, "blacklistedInEU": { "description": "When the flight has a marketing or/and operating airline that is identified as blacklisted by the European Commission. \n\nTo improve travel safety, the European Commission regularly updates the list of the banned carriers from operating in Europe. It allows any Travel Agency located in the European Union to easily identify and hide any travel recommendation based on some unsafe airlines. \nThe [list of the banned airlines](https://ec.europa.eu/transport/sites/transport/files/air-safety-list_en.pdf) 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 \n", "type": "boolean", "example": false }, "co2Emissions": { "description": "Co2 informations", "type": "array", "minItems": 1, "items": { "type": "object", "properties": { "weight": { "description": "Weight of Co2 emitted for the concerned segment", "type": "integer", "example": 90 }, "weightUnit": { "description": "Code to qualify unit as pounds or kilos", "type": "string", "example": "KG" }, "cabin": { "$ref": "#/definitions/TravelClass" } } } } } }, { "type": "object", "description": "defining a flight segment; including both operating and marketing details when applicable", "properties": { "departure": { "title": "FlightEndPoint", "description": "departure or arrival information", "allOf": [ { "$ref": "#/definitions/OriginalFlightEndPoint" }, { "type": "object", "properties": { "at": { "description": "local date and time in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) YYYY-MM-ddThh:mm:ss format, e.g. 2017-02-10T20:40:00", "type": "string", "format": "date-time", "example": "2017-10-23T20:00:00" } } } ] }, "arrival": { "title": "FlightEndPoint", "description": "departure or arrival information", "allOf": [ { "$ref": "#/definitions/OriginalFlightEndPoint" }, { "type": "object", "properties": { "at": { "description": "local date and time in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) YYYY-MM-ddThh:mm:ss format, e.g. 2017-02-10T20:40:00", "type": "string", "format": "date-time", "example": "2017-10-23T20:00:00" } } } ] }, "carrierCode": { "type": "string", "description": "providing the airline / carrier code", "minLength": 1, "maxLength": 2, "example": "DL" }, "number": { "type": "string", "description": "the flight number as assigned by the carrier", "minLength": 1, "maxLength": 4, "example": "212" }, "suffix": { "type": "string", "description": "the flight number suffix as assigned by the carrier", "minLength": 1, "maxLength": 4, "example": "string-value" }, "aircraft": { "description": "information related to the aircraft", "properties": { "code": { "type": "string", "description": "IATA aircraft code (http://www.flugzeuginfo.net/table_accodes_iata_en.php)\n", "pattern": "[a-zA-Z0-9]{3}", "example": "318" }, "configurationVersion": { "type": "string", "description": "aircraft Configuration Version code. Physical configuration, also called ACV code (aircraft type + fitted configuration)\n", "pattern": "[A-Z0-9]{3}", "example": "2C1" } } }, "class": { "type": "string", "description": "reservation booking designator (RBD) of the carrier", "minLength": 1, "maxLength": 2, "example": "string-value" }, "cabin": { "type": "string", "description": "booking cabin / class of service of the carrier", "example": "string-value" }, "operating": { "type": "object", "description": "information about the operating flight", "properties": { "carrierCode": { "type": "string", "description": "providing the airline / carrier code", "minLength": 1, "maxLength": 2, "example": "DL" }, "number": { "type": "string", "description": "the flight number as assigned by the carrier", "minLength": 1, "maxLength": 4, "example": "212" }, "suffix": { "type": "string", "description": "the flight number suffix as assigned by the carrier", "minLength": 1, "maxLength": 4, "example": "string-value" } } }, "duration": { "type": "string", "description": "stop duration in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) PnYnMnDTnHnMnS format, e.g. PT2H10M", "example": "PT2H10M" }, "stops": { "type": "array", "description": "information regarding the different stops composing the flight segment. E.g. technical stop, change of gauge...", "items": { "title": "FlightStop", "description": "details of stops for direct or change of gauge flights", "allOf": [ { "$ref": "#/definitions/OriginalFlightStop" }, { "type": "object", "properties": { "arrivalAt": { "description": "arrival at the stop in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) YYYY-MM-ddThh:mm:ss format, e.g. 2017-02-10T20:40:00", "type": "string", "format": "date-time", "example": "2017-10-23T20:00:00" }, "departureAt": { "description": "departure from the stop in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) YYYY-MM-ddThh:mm:ss format, e.g. 2017-02-10T20:40:00", "type": "string", "format": "date-time", "example": "2017-10-23T20:00:00" } } } ] } } } } ] }