我嘗試使用JSONPath獲取名爲version(第一個)的變量的值,但顯然我的解決方案根本無法工作。 我試圖使用像$ ..版本或$ .container ..版本的表達式。如何從json響應中獲取數據作爲變量
我的迴應如下:
你粘貼的JSON的{
"container" : {
"version" : 8,
"updatedBy" : "user111",
"updatedOn" : "2017-08-17T16:00:24Z",
"id" : 16,
"dataEnt" : {
"dataEntid" : "dataEntid-000032",
"dataEnttype" : "21"
},
"impact" : [ ],
"operationalFocus" : false,
"periodicity" : {
"version" : 0,
"updatedBy" : "unknown",
"updatedOn" : "2017-03-31T16:44:08Z",
"step" : 1,
"period" : 31084132,
"_VALIDATION" : {
"valid" : true,
"saveAll" : true,
"reasons" : [ ],
"details" : {
"period" : {
"valid" : true,
"saveAll" : true,
"risks" : [ ],
"rmiCode" : null,
"rmiMessage" : null
},
"version" : {
"valid" : true,
"saveAll" : true,
"risks" : [ ],
"rmiCode" : null,
"rmiMessage" : null
},
"step" : {
"valid" : true,
"saveAll" : true,
"risks" : [ ],
"rmiCode" : null,
"rmiMessage" : null
}
},
"rmiCode" : null,
"rmiMessage" : null
},
"_META" : { }
}