【发布时间】:2017-03-08 14:25:21
【问题描述】:
我有以下 JSON:
{
"X":20,
"Y":null
}
现在,对于键 Y,我需要在 json 数组下方插入。
{
"A":null,
"B":1,
"C":5000,
"D":0.25
}
我试过了,但没有用:
String response1 =
given()
.cookie(apiTestSessionID)
//.spec(requestSpecification)
.when()
//.get("/service/bill/Config")
.get("/service/bill/Config/0001")
.asString();
JsonPath jsonCstmrConfig = new JsonPath(response);
String response2 = given()
.cookie(apiTestSessionID)
.when()
.get("/service/commoncache/card")
.asString();
JsonPath jsonSoiRateCard = new JsonPath(response2);
Map<String,String> maps = jsonCstmrConfig.getMap("data");
maps.put("X","Value");
有没有什么办法可以用提供的放心的json库来做到这一点。
【问题讨论】:
标签: json gson rest-assured