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

feat: add github.com/tailscale/hujson extensions #1294

Merged
merged 1 commit into from
Sep 22, 2023

Conversation

bassosimone
Copy link
Contributor

The hujson is a JSON package from tailscale allowing JSON files to contain comments that is also more liberal with respect to commas.

We want to slowly upgrade all user-facing JSON-parsing code to use this more relaxed standard for parsing JSONs, because that would make our user's life significantly simpler in terms of writing and updating those files.

In the short term, I would like the configuration file driving the usage of beacons to use this relaxed parsing.

To this end, I am adding handy wrappers that combine using hujson with using the standard library parser to have a single hujson aware parsing function that behaves like the standard library's json.Unmarshal.

Part of ooni/probe#2531

The hujson is a JSON package from tailscale allowing JSON files to contain
comments that is also more liberal with respect to commas.

We want to slowly upgrade all user-facing JSON-parsing code to use this
more relaxed standard for parsing JSONs, because that would make our user's
life significantly simpler in terms of writing and updating those files.

In the short term, I would like the configuration file driving the
usage of beacons to use this relaxed parsing.

To this end, I am adding handy wrappers that combine using hujson with
using the standard library parser to have a single hujson aware parsing
function that behaves like the standard library's json.Unmarshal.

Part of ooni/probe#2531
@bassosimone bassosimone merged commit a0f51b7 into master Sep 22, 2023
6 checks passed
@bassosimone bassosimone deleted the issue/2531-small branch September 22, 2023 08:26
Murphy-OrangeMud pushed a commit to Murphy-OrangeMud/probe-cli that referenced this pull request Feb 13, 2024
The hujson is a JSON package from tailscale allowing JSON files to
contain comments that is also more liberal with respect to commas.

We want to slowly upgrade all user-facing JSON-parsing code to use this
more relaxed standard for parsing JSONs, because that would make our
user's life significantly simpler in terms of writing and updating those
files.

In the short term, I would like the configuration file driving the usage
of beacons to use this relaxed parsing.

To this end, I am adding handy wrappers that combine using hujson with
using the standard library parser to have a single hujson aware parsing
function that behaves like the standard library's json.Unmarshal.

Part of ooni/probe#2531
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

Successfully merging this pull request may close these issues.

1 participant