How to add new node to Json using JsonPath?
问题 I'm working with JSON and facing some problems. I want to insert/update a path in a JSON object. In the case that the path doesn't exist, it will be created then I insert a new value. In case that it exits, it will be updated by a new value For example, I want to add new path like this: val doc = JsonPath.parse(jsonString) doc.add("$.user.name", "John") but I always get this error, because the path doesn't exist: class com.jayway.jsonpath.PathNotFoundException : Missing property in path $[