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-encoding a Symbol may result in invalid JSON #63

Closed
yurivish opened this issue Jun 25, 2020 · 1 comment
Closed

JSON-encoding a Symbol may result in invalid JSON #63

yurivish opened this issue Jun 25, 2020 · 1 comment

Comments

@yurivish
Copy link
Contributor

This happens because the value of a symbol is not escaped and e.g. double quotes in the input turn into unesaped double quotes in the output:

julia> JSON3.read(JSON3.write([Symbol("before \" after")]))
ERROR: ArgumentError: invalid JSON at byte position 12 while parsing type JSON3.Array: ExpectedComma

This can happen as a result of reading a JSON file:

julia> print(copy(JSON3.read("""{"before \\" after": true}""")))
Dict{Symbol,Any}(Symbol("before \" after") => true)
@quinnj
Copy link
Owner

quinnj commented Jun 29, 2020

Fix is up: #64

@quinnj quinnj closed this as completed in 3f6efcf Jun 29, 2020
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

2 participants