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

Pretty printing doesn't escape quotes #275

Open
STOpandthink opened this issue Dec 12, 2023 · 1 comment
Open

Pretty printing doesn't escape quotes #275

STOpandthink opened this issue Dec 12, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@STOpandthink
Copy link

STOpandthink commented Dec 12, 2023

JSON v1.13.2
Julia 1.9.4

hello_world = Dict("\"a\"" => 1)

open("my_new_file.json", "w") do io
    JSON3.pretty(io, hello_world)
end

Will result in:

{
    ""a"": 1
}

Which is not valid JSON.

@quinnj
Copy link
Owner

quinnj commented Dec 21, 2023

Yeah, this is definitely wrong. It's not common to have quoted JSON keys, but these should definitely be quoted.

@quinnj quinnj added the bug Something isn't working label Dec 21, 2023
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

2 participants