JSON type serialization

With LazyJSON, it will seem that you get an AbstractVector{Any}. However, because of the lazy implementation, no vector has actually been created yet. So, if you then convert to a desired vector type, the vector will be constructed by directly parsing the JSON text (there is no intermediate Vector{Any} representation).

julia> using LazyJSON
LazyJSON.
julia> x = LazyJSON.value("""{"a": [1,2,3,4]}""")
LazyJSON.Object{String} with 1 entry:
  "a" => Any[1, 2, 3, 4]

julia> v = convert(Vector{Int}, x.a)
4-element Array{Int64,1}:
 1
 2
 3
 4
1 Like