# Parse json to vector{T} for known T

**URL:** <https://discourse.julialang.org/t/parse-json-to-vector-t-for-known-t/123469>\
**Category:** General Usage\
**Created:** [December 4, 2024, 7:09pm UTC](https://discourse.julialang.org/t/parse-json-to-vector-t-for-known-t/123469 "2024-12-04T19:09:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kingoslo](https://avatars.discourse-cdn.com/v4/letter/k/7cd45c/32.png) [@kingoslo](https://discourse.julialang.org/u/kingoslo)\
**Post date:** [December 4, 2024, 7:09pm UTC](https://discourse.julialang.org/t/parse-json-to-vector-t-for-known-t/123469/1 "2024-12-04T19:09:41Z")

</div>

Am trying to use the JSON package to parse “[1,2,3]” to a vector{Int64}.

I notice that the parse method has optional arguments dicttype and inttype. But it seems that whatever I give as as dicttype and inttype the function returns vector{any} instead of vector{Int64}. How should I specify these?

```julia
julia> using JSON
julia> x = JSON.parse("[1,2,3]"; dicttype=Vector{Int64}, inttype=Int64)
3-element Vector{Any}:
 1
 2
 3

```

---

<div class="post-metadata">

**Author:** ![quinnj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/quinnj/32/11_2.png) [@quinnj](https://discourse.julialang.org/u/quinnj)\
**Post date:** [December 4, 2024, 8:07pm UTC](https://discourse.julialang.org/t/parse-json-to-vector-t-for-known-t/123469/2 "2024-12-04T20:07:06Z")

</div>

JSON.jl doesn’t support this level of type specificity. You can use JSON3.jl which supports the syntax like `JSON3.read(json, Vector{Int})`.
