api - 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>\"}]}"
}
解决方案
@塞缪尔,
分析您的请求,我发现服务$.OriginDestinationInformation.TPA_Extensions.SegmentType.code="0"不是必填字段,也就是说。
搜索可用性时不需要使用此属性。
推荐阅读
- nativescript - 自定义扩展活动不适用于 Nativescript 7
- python - 在 Python 的打印函数中使用分隔符参数时遇到问题
- wcf - WCF 客户端调用 api 与承载令牌(.net 核心 3.1) - 未经授权的调用
- sccm - Microsoft 365 应用更新的自动部署失败,错误代码为 0x87D20417 - SCCM
- warnings - 此公式使用目前不支持评估的范围 - 这与我的 O365 许可证类型有关吗?
- javascript - 迷你边框调整点游戏
- c - 如何用“y”位移“x”?
- reactjs - React:当用户名和密码正确时,我如何制作一个只能从登录屏幕访问的隐藏页面?
- javascript - 来自队列的响应
- node.js - npm 错误!cb.apply 不是 NPM Nodist 中的函数