Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Library missing pointer syntax #368

Open
nicmcd opened this issue Oct 7, 2021 · 0 comments
Open

Library missing pointer syntax #368

nicmcd opened this issue Oct 7, 2021 · 0 comments

Comments

@nicmcd
Copy link

nicmcd commented Oct 7, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant