首页 > 解决方案 > Bargain Finder - cvc-enumeration-valid 错误

问题描述

尝试向 Bargain Finder API 发送请求时出现错误。它似乎与“SegmentType”结构中的“代码”变量有关,我想知道是什么导致了这个错误以及如何修复它,以及成功响应的最小/必需值是什么。(“https ://api.sabre.com/v4.3.0/shop/altairports/flights?mode=live")。我非常感谢您的帮助

JSON请求:

{
  "OTA_AirLowFareSearchRQ": {
    "TravelPreferences": {
      "VendorPref": [
        {
          "Code": "YY",
          "PreferLevel": "Unacceptable"
        }
      ]
    },
    "TPA_Extensions": {
      "IntelliSellTransaction": {
        "RequestType": {
          "Name": "200ITINS"
        }
      }
    },
    "POS": {
      "Source": [
        {
          "PseudoCityCode": "XXXX",
          "RequestorID": {
            "Type": "0.AAA.X",
            "ID": "REQ.ID",
            "CompanyName": {
              "Code": "TN"
            }
          }
        }
      ]
    },
    "OriginDestinationInformation": [
      {
        "RPH": "1",
        "DepartureDateTime": "2020-10-16T11:27:00",
        "OriginLocation": {
          "LocationCode": "ATL"
        },
        "DestinationLocation": {
          "LocationCode": "BOS"
        },
        "TPA_Extensions": {
          "SegmentType": {
            "Code": "o"
          },
          "Flight": [
            {
              "Number": 1200,
              "DepartureDateTime": "2020-12-16T11:27:00",
              "ArrivalDateTime": "2020-12-16T13:58:00",
              "Type": "A",
              "ClassOfService": "Y",
              "BookingDateTime": "2020-11-01T10:03:00",
              "OriginLocation": {
                "LocationCode": "ATL"
              },
              "DestinationLocation": {
                "LocationCode": "BOS"
              },
              "Airline": {
                "Operating": "K0",
                "Marketing": "K0"
              }
            }
          ]
        }
      }
    ],
    "TravelerInfoSummary": {
      "SeatsRequested": [
        1
      ],
      "AirTravelerAvail": [
        {
          "PassengerTypeQuantity": [
            {
              "Code": "ADT",
              "Quantity": 1
            }
          ]
        }
      ],
      "PriceRequestInformation": {
        "NegotiatedFaresOnly": false,
        "Reprice": false,
        "ProcessThruFaresOnly": false,
        "TPA_Extensions": {
          "Priority": {
            "Price": {
              "Priority": 1
            },
            "DirectFlights": {
              "Priority": 2
            },
            "Time": {
              "Priority": 3
            },
            "Vendor": {
              "Priority": 4
            }
          }
        }
      }
    }
  }
}

回复:

{
"status": "Unknown",
"reportingSystem": "RAF",
"timeStamp": "2020-09-23T17:50:41+00:00",
"type": "Application",
"errorCode": "ERR.RAF.APPLICATION",
"instance": "raf-darhlc005.sabre.com-8080",
"message": "{\"OTA_AirLowFareSearchRS\":{\"Version\":\"4.3.0\",\"Errors\":{\"Error\":[{\"Type\":\"SERVER\",\"ShortText\":\"80\",\"Code\":\"ase032lpscil7c6\",\"content\":\"TOMCAT\"},{\"Type\":\"ERR\",\"ShortText\":\"Schema Validation Failed\",\"Code\":\"INVALIDREQ\",\"content\":\"cvc-enumeration-valid: Value 'o' is not facet-valid with respect to enumeration '[ARUNK, O, X]'. It must be a value from the enumeration.\"},{\"Type\":\"ERR\",\"ShortText\":\"Schema Validation Failed\",\"Code\":\"INVALIDREQ\",\"content\":\"cvc-attribute.3: The value 'o' of attribute 'Code' on element 'ns0:SegmentType' is not valid with respect to its type, 'null'.\"}]}},\"Links\":[{\"rel\":\"self\",\"href\":\"https://api-crt.cert.havail.sabre.com/v4.3.0/shop/flights?mode=live\"},{\"rel\":\"linkTemplate\",\"href\":\"https://api-crt.cert.havail.sabre.com/<version>/shop/flights?mode=<mode>&limit=<limit>&offset=<offset>&enabletagging=<enabletagging>\"}]}"

}

标签: apisabre

解决方案


@塞缪尔,

分析您的请求,我发现服务$.OriginDestinationInformation.TPA_Extensions.SegmentType.code="0"不是必填字段,也就是说。

搜索可用性时不需要使用此属性。


推荐阅读