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

JSON viewer should add double-quotes around properties that need it. #166

Open
evert opened this issue Nov 25, 2022 · 0 comments
Open

JSON viewer should add double-quotes around properties that need it. #166

evert opened this issue Nov 25, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@evert
Copy link
Member

evert commented Nov 25, 2022

We're basically using JSON5 syntax, and while this is legal:

{
  foo: "bar"
}

If the key contains (for example) a space we should encode like this:

{
  "foo 1 2": "bar"
}

So we should add quotes if the key name would be illegal with the quotes. This also includes empty keys, e.g:

{
  "": "hello world, yes this is legal
}

Real world example:

image

@evert evert added the bug Something isn't working label Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant