0
我有以下的JSON:如何将json数据数组插入现有的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库。
由于它的工作原理。 – ButterSkotch
@RajanVerma很高兴它帮助你... – Uttam
嗨乌坦,我面临的问题更少,你能否也请帮忙。 http://stackoverflow.com/q/42691109/7640781 – ButterSkotch