# How to read NamedTtuples with JSON3?

**URL:** https://discourse.julialang.org/t/how-to-read-namedttuples-with-json3/31597
**Category:** New to Julia
**Created:** [November 27, 2019, 7:34pm UTC](https://discourse.julialang.org/t/how-to-read-namedttuples-with-json3/31597 "2019-11-27T19:34:16Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Elmer\_Cusipuma](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elmer_cusipuma/32/11958_2.png) [@Elmer\_Cusipuma](https://discourse.julialang.org/u/Elmer_Cusipuma)
#### Post date: [November 27, 2019, 7:34pm UTC](https://discourse.julialang.org/t/how-to-read-namedttuples-with-json3/31597/1 "2019-11-27T19:34:16Z")

</div>

I am trying to do the following

```julia
using JSON3

struct data
    d::NamedTuple{(:a,:b,:c), Tuple{Symbol,T,T}} where T <: Union{Nothing,Real}
end

JSON3.StructType(::Type{data}) = JSON3.Struct()

```

But I get an error reading the object

```julia
JSON3.read("{\"d\":{\"a\":\"n\",\"b\":1,\"c\":1}}", data)
ERROR: UndefVarError: types not defined

```
