[英]How is the "Normalized path expressions" option to Jayway JsonPath used?
我想對 Jayway JsonPath
使用“規范化路徑表達式”選項,如本示例所示。 JsonPath
的文檔顯示了這個簡單的示例:
String json = "...";
List<String> authors = JsonPath.read(json, "$.store.book[*].author");
我想打電話
List<String> allPaths = JsonPath.read(json, "$..*", <option here?>);
並獲得結果為“規范化路徑表達式”,如本例所示。 請問這是怎么做的?
這有效
import com.jayway.jsonpath.Configuration;
import static com.jayway.jsonpath.JsonPath.using;
import static com.jayway.jsonpath.Option.AS_PATH_LIST;
Configuration conf = Configuration.builder().options(AS_PATH_LIST).build();
ArrayList<String> allPaths = using(conf).parse(jsonString).read("$..*");
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.