0
我有時需要在價值觀與空解析JSON這樣的:JSONPath無法找到空鍵的值
{"someKey" : null}
,並驗證someKey值爲空,但似乎不可能:
所有其他jsonPath被轉換成字符串像這樣:
{"someKey" : 2}
.check(jsonPath("$.someKey").is("2")) //pass
但空:
{"someKey" : null}
.check(jsonPath("$.someKey").is("null"))
//jsonPath($.extMediaThumbnailId).find(0).is(null), but actually found nothing
.is(null)
檢查返回空指針異常
也許這是一個錯誤有沒有一種方法來檢查JSON值爲null與jsonPath?