-
Notifications
You must be signed in to change notification settings - Fork 106
Closed
Description
Using JSON3.jl, I've been successfully roundtripping dictionaries with integer keys:
JSON3.read(JSON3.write(Dict(1=>1), Dict{Int,Int})
# SuccessI'm aware that JSON object keys are strings so the produced JSON is actually "{\"1\":1}", but I've assumed the successful deserialization was by design.
Using JSON.jl, this errors:
JSON.parse(JSON.json(Dict(1=>1)), Dict{Int,Int})
# ERROR: MethodError: Cannot `convert` an object of type String to an object of type Int64Is this to do with StructUtils.jl being less forgiving by default than StructTypes.jl?
In my specific use case I can actually replace my dictionary with a vector, but in general I might not have been able to.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels