Open ZacharieALES opened 3 years ago
After some reading, I found that the name of an object in json is necessarily a string.
I replaced the type Dict{Dict{String, Int}
by Vector{Vector{Any}}
which is not completely satisfactory but works.
Personally I think JSON.jl should error on such keys and not just naively stringify them.
That would have saved me some debugging and reading ^^'.
When I save into a json file a Dict which contains a Dict as a key, the key is replaced by a string.
Here is an example:
d = Dict{Dict{String, Int}, Int}(Dict("v1" => 1) => 2)
I save variable
d
usingThe problem is that I get the following json file:
and when I read the file, due to the quotation marks,
Dict(\"v1\" => 1)
is considered to be a String rather than a Dict{String, Int}:Can I write and read in json a Dict which has a Dict as keys?