# JSON type serialization

**URL:** <https://discourse.julialang.org/t/json-type-serialization/9794>\
**Category:** General Usage\
**Created:** [March 18, 2018, 6:18pm UTC](https://discourse.julialang.org/t/json-type-serialization/9794 "2018-03-18T18:18:40Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![samoconnor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/samoconnor/32/1802_2.png) [@samoconnor](https://discourse.julialang.org/u/samoconnor)\
**Post date:** [March 26, 2018, 10:46pm UTC](https://discourse.julialang.org/t/json-type-serialization/9794/12 "2018-03-26T22:46:24Z")

</div>

With [LazyJSON](https://discourse.julialang.org/t/announce-a-different-way-to-read-json-data-lazyjson-jl/9046), 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
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

```

---

_[View the full topic](https://discourse.julialang.org/t/json-type-serialization/9794)._
