quinnj / JSON3.jl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Option to convert JSON3 object to Dict{String,Any}

mkshirazi opened this issue · comments

Currently copy() converts JSON3 object to Dict{Symbol,Any}. A keyword argument should be provided to allow conversion to Dict{String,Any}. This will allow accessing the elements by using a string, like we do in JSON3 objects.

a = JSON3.read(""" {"a":"test"}""")
a["a"] # works fine

b = copy(a)
b[:a] # works fine
b["a"] # throws an error

I am happy to implement it if there are no objections

I believe that JSON3.read("""{"a":"test"}""",Dict{String,Any}) already does what you want.