Rest 如何知道哪种票价成分与BargainFinderMarx中的细分市场相关

Rest 如何知道哪种票价成分与BargainFinderMarx中的细分市场相关,rest,sabre,Rest,Sabre,rest api BargainFinderMaxRS groupedItineraryResponse对象为我提供了支腿及其明细表(段)。它还提供了passengerInfo中的票价组件。但我不知道哪个票价部分属于哪个航段。我看不到任何标识符,比如“id”或“ref”,将特定航班段链接到其票价组件。我错过什么了吗 谢谢 legs: [ 0: { id: 1, schedules: [ 0: {...}, 1: {...} ] }, 1

rest api BargainFinderMaxRS groupedItineraryResponse对象为我提供了支腿及其明细表(段)。它还提供了passengerInfo中的票价组件。但我不知道哪个票价部分属于哪个航段。我看不到任何标识符,比如“id”或“ref”,将特定航班段链接到其票价组件。我错过什么了吗

谢谢

legs: [
  0: {
    id: 1,
    schedules: [
      0: {...},
      1: {...}
    ]
  },
  1: {
    id: 2,
    schedules: [
      0: {...}
    ]
  }
]

...

passengerInfo: {
  fareComponents: [
    0: {...},
    1: {...},
    2: {...}
  ]
}
编辑好的,我想我知道如何将支腿与部件匹配,但我仍然有问题。有时,legs和fare组件的数组索引似乎匹配,但有时却不匹配

在一般情况下,第一条腿有两段,第二条腿是不间断的。但是第一个组件有1个段,第二个组件有2个段。显然,组件2属于法律1

以下是来自BFM响应对象的my Legs数组:

"legs": [
{
  "ref": 3,
  "id": 3,
  "schedules": [
    {
      "ref": 13,
      "id": 13,
      "dotRating": "9",
      "frequency": "SMTWT**",
      "stopCount": 0,
      "eTicketable": true,
      "totalMilesFlown": 2556,
      "departure": {
        "airport": "HNL",
        "city": "HNL",
        "state": "HI",
        "country": "US",
        "time": "20:55:00-10:00",
        "terminal": "2"
      },
      "arrival": {
        "airport": "LAX",
        "city": "LAX",
        "state": "CA",
        "country": "US",
        "time": "05:18:00-07:00",
        "terminal": "2",
        "dateAdjustment": 1
      },
      "carrier": {
        "marketing": "DL",
        "marketingFlightNumber": 1212,
        "operating": "DL",
        "operatingFlightNumber": 1212,
        "equipment": {
          "code": "739",
          "typeForFirstLeg": "N",
          "typeForLastLeg": "N"
        }
      }
    },
    {
      "ref": 12,
      "departureDateAdjustment": 1,
      "id": 12,
      "dotRating": "8",
      "frequency": "SMTWT**",
      "stopCount": 0,
      "eTicketable": true,
      "totalMilesFlown": 953,
      "departure": {
        "airport": "LAX",
        "city": "LAX",
        "state": "CA",
        "country": "US",
        "time": "09:38:00-07:00",
        "terminal": "3"
      },
      "arrival": {
        "airport": "SEA",
        "city": "SEA",
        "state": "WA",
        "country": "US",
        "time": "12:27:00-07:00"
      },
      "carrier": {
        "marketing": "DL",
        "marketingFlightNumber": 2540,
        "operating": "DL",
        "operatingFlightNumber": 2540,
        "equipment": {
          "code": "739",
          "typeForFirstLeg": "N",
          "typeForLastLeg": "N"
        }
      }
    }
  ]
},
{
  "ref": 6,
  "id": 6,
  "schedules": [
    {
      "ref": 10,
      "id": 10,
      "dotRating": "9",
      "frequency": "****TF*",
      "stopCount": 0,
      "eTicketable": true,
      "totalMilesFlown": 2676,
      "departure": {
        "airport": "SEA",
        "city": "SEA",
        "state": "WA",
        "country": "US",
        "time": "08:20:00-07:00"
      },
      "arrival": {
        "airport": "HNL",
        "city": "HNL",
        "state": "HI",
        "country": "US",
        "time": "11:29:00-10:00",
        "terminal": "2"
      },
      "carrier": {
        "marketing": "DL",
        "marketingFlightNumber": 1887,
        "operating": "DL",
        "operatingFlightNumber": 1887,
        "equipment": {
          "code": "753",
          "typeForFirstLeg": "N",
          "typeForLastLeg": "N"
        }
      }
    }
  ]
}
]

以下是组件阵列:

"fareComponents": [
            {
              "ref": 1,
              "segments": [
                {
                  "segment": {
                    "bookingCode": "V",
                    "cabinCode": "Y",
                    "mealCode": "D",
                    "seatsAvailable": 4,
                    "availabilityBreak": true
                  }
                }
              ],
              "id": 1,
              "governingCarrier": "DL",
              "fareAmount": 137.31,
              "fareCurrency": "USD",
              "fareBasisCode": "VA0SLOME/LN75",
              "farePassengerType": "JCB",
              "ticketDesignator": "LN75",
              "publishedFareAmount": 274.62,
              "negotiatedFare": true,
              "privateFare": true,
              "directionality": "FROM",
              "direction": "WH",
              "notValidAfter": "2019-08-31",
              "applicablePricingCategories": "5 10 15 16 18 25 35",
              "vendorCode": "ATP",
              "fareTypeBitmap": "0E",
              "fareType": "SIP",
              "fareTariff": "191",
              "fareRule": "8694"
            },
            {
              "ref": 5,
              "segments": [
                {
                  "segment": {
                    "bookingCode": "V",
                    "cabinCode": "Y",
                    "mealCode": "B",
                    "seatsAvailable": 4,
                    "availabilityBreak": true
                  }
                },
                {
                  "segment": {
                    "bookingCode": "V",
                    "cabinCode": "Y",
                    "mealCode": "B",
                    "seatsAvailable": 9,
                    "availabilityBreak": true
                  }
                }
              ],
              "id": 5,
              "governingCarrier": "DL",
              "fareAmount": 137.31,
              "fareCurrency": "USD",
              "fareBasisCode": "VA0SLOME/LN75",
              "farePassengerType": "JCB",
              "ticketDesignator": "LN75",
              "publishedFareAmount": 274.62,
              "negotiatedFare": true,
              "privateFare": true,
              "directionality": "TO",
              "direction": "WH",
              "notValidAfter": "2019-08-31",
              "applicablePricingCategories": "5 10 15 16 18 25 35",
              "vendorCode": "ATP",
              "fareTypeBitmap": "0E",
              "fareType": "SIP",
              "fareTariff": "191",
              "fareRule": "8694"
            }
          ]

讨价还价者的反应与价格不符。行程分组(航段),每个行程都有自己的价格

编辑:我误解了这个问题。你没有遗漏什么,你是对的。首先,您需要使用行程的“legs”属性,根据它的ref值对legs进行分组。您需要使用该信息对段段分段进行排序,然后您将看到分段计数和票价分量-->段属性计数是相同的。它们的索引也一样。我的意思是,分类后你有3条腿:

立法1 立法2 立法3

您有3个票价部分:

票价构成1 票价构成2 票价构成3

结果如下:

立法会1自有票价组成部分1

立法会2自有票价组成部分2


。。。等等我希望这能有所帮助。

谢谢,这正是我所需要的。我只是不确定假设腿的索引与组件的索引匹配是否安全。