From 4c97e0aa77af693df487da9ddb0ab20ab63f1463 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Bertaux?= Date: Fri, 18 Oct 2019 10:06:53 +0200 Subject: [PATCH 1/2] Add a part in the readme describing how to set a value --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 34fad239..75447dcc 100644 --- a/README.md +++ b/README.md @@ -340,6 +340,15 @@ assertThat(pathList).containsExactly( "$['store']['book'][3]['author']"); ``` +Set a value +----------- +The library offers the possibility to set a value. + +```java +String newJson = parse(json).set("$['store']['book'][0]['author']", "Paul").jsonString(); +``` + + Tweaking Configuration ---------------------- From dfbaf890f976e1905b2a9d5431130192e217b0e1 Mon Sep 17 00:00:00 2001 From: JBertaux Date: Mon, 3 Feb 2020 15:02:31 +0100 Subject: [PATCH 2/2] Update README.md Co-Authored-By: Alan Wang <948467222@qq.com> --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 75447dcc..6b0d2953 100644 --- a/README.md +++ b/README.md @@ -345,7 +345,7 @@ Set a value The library offers the possibility to set a value. ```java -String newJson = parse(json).set("$['store']['book'][0]['author']", "Paul").jsonString(); +String newJson = JsonPath.parse(json).set("$['store']['book'][0]['author']", "Paul").jsonString(); ``` @@ -478,4 +478,3 @@ CacheProvider.setCache(new Cache() { [![Analytics](https://ga-beacon.appspot.com/UA-54945131-1/jsonpath/index)](https://github.com/igrigorik/ga-beacon) -