JSON that has been encoded as a string can easily be parsed into a standard Julia type:
julia> using JSON
julia> JSON.parse("""{
"this": ["is", "json"],
"numbers": [85, 16, 12.0],
"and": [true, false, null]
}""")
Dict{String,Any} with 3 entries:
"this" => Any["is","json"]
"numbers" => Any[85,16,12.0]
"and" => Any[true,false,nothing]
There are a few immediate properties of JSON.jl of note:
Dict
, array becomes Vector
, number becomes Int64
or Float64
, boolean becomes Bool
, and null becomes nothing::Void
.Vector{Any}
, and returned dictionaries are of type Dict{String, Any}
.Int64
, whereas a number with a decimal point is parsed into Float64
. This matches closely with the behavior of JSON parsers in many other languages.