我有输出Json
{
"id": "641f295a-9db7-4013-a909-3fede326897d",
"result": {
"action": "order_status",
"actionIncomplete": false,
"contexts": [],
"fulfillment": {
"messages": [
{
"lang": "en",
"speech": "Please choose any of the following options: \n<ul class=\"botResponse\">\n<li><a href=\"#\" onclick=bot.sendEvent('Order_Details')> Order Status basis Order Number </a></li>\n<li><a href=\"#\" onclick=bot.sendEvent('Customer_Name')> Order Status basis Customer Name </a></li>\n</ul>",
"type": 0
}
],
"speech": "Please choose any of the following options: \n<ul class=\"botResponse\">\n<li><a href=\"#\" onclick=bot.sendEvent('Order_Details')> Order Status basis Order Number </a></li>\n<li><a href=\"#\" onclick=bot.sendEvent('Customer_Name')> Order Status basis Customer Name </a></li>\n</ul>"
},
"metadata": {
"intentId": "641f295a-9db7-4013-a909-3fede326897d",
"intentList": [
"Order_Status"
],
"intentName": "Order_Status",
"webhookUsed": "false"
},
"parameters": {},
"resolvedQuery": "status for all orders",
"score": 0.7271162920052577,
"source": "agent"
},
"sessionId": "12345",
"status": {
"code": 200,
"errorType": "success"
},
"timestamp": "2019-07-26T18:05:44.357705"
}
并且需要与具有嵌套 dic 列表对象的相同类型的输入 json 进行比较。在列上:sessionId
status.code status.errorType
result.metadata.intentName
动作动作不完整
result.fulfillment.messages
result.fulfillment.speech
result.metadata.intentId
result.metadata.intentList
参数
结果.上下文
我已经完成了字符串比较,但是由于一些额外的字符,它给出了错误