EindbaasExpress / handsonscala-issuemigrator

Part of the HandsOnScala Course
0 stars 0 forks source link

Library missing pointer syntax #123

Open EindbaasExpress opened 2 years ago

EindbaasExpress commented 2 years ago

Please consider implementing Section 3 of RFC6901 which provides pointer syntax. This is VERY useful for modifying the JSON structures. For example, suppose I have a program that takes a JSON file, and JSON pointer, a new value, then writes the updated JSON to the file:

$> ./json_update stuff.json /hello/foo/7 world

The code is easy to implement the update like this:

val json = read_json_from_file(args(0))
json(args(1)) = args(2)
write_json_to_file(json, args(0))

This is implemented nicely in the highly popular nlohmann::json C++ library: see here

ID: 368 Original Author: nicmcd