# \[ANN\] JSON3.jl 1.0 Release + new StructTypes.jl Package

**URL:** <https://discourse.julialang.org/t/ann-json3-jl-1-0-release-new-structtypes-jl-package/34700>\
**Category:** Data\
**Created:** [February 16, 2020, 2:14am UTC](https://discourse.julialang.org/t/ann-json3-jl-1-0-release-new-structtypes-jl-package/34700 "2020-02-16T02:14:46Z")\
**Posts on this page:** 2\
**Page:** 1

<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:** [February 16, 2020, 2:14am UTC](https://discourse.julialang.org/t/ann-json3-jl-1-0-release-new-structtypes-jl-package/34700/1 "2020-02-16T02:14:46Z")

</div>

Just tagged a 1.0 release for [JSON3.jl](https://github.com/quinnj/JSON3.jl). Highlights include:

- Moving the core `StructType` trait into a separate package [StructTypes.jl](https://github.com/JuliaData/StructTypes.jl), to allow further integration/re-use by other packages; what this means is that instead of overloading `JSON3.StructType(::Type{MyType})`, you overload `StructTypes.StructType(::Type{MyType})`
- A breaking change where `JSON3.write(NaN)` will now throw an error as non-finite values (e.g. `NaN`, `Inf`, etc.) are not permitted in the JSON spec; this means code dealing w/ numbers will need to handle this before calling `JSON3.write` and write out as `null` themselves (like `JSON3.write(isfinite(x) ? x : nothing)`)
- Dedicated documentation at [Home · JSON3.jl](https://quinnj.github.io/JSON3.jl/stable)
- Updated documentation for [`StructTypes.jl`](https://juliadata.github.io/StructTypes.jl/stable/) as well

As always, don’t hesitate to open an issue with questions or concerns or drop by the #data slack channel to ask.

-Jacob

---

<div class="post-metadata">

**Author:** ![Martin\_Florek](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@Martin\_Florek](https://discourse.julialang.org/u/Martin_Florek)\
**Post date:** [September 25, 2020, 9:17am UTC](https://discourse.julialang.org/t/ann-json3-jl-1-0-release-new-structtypes-jl-package/34700/2 "2020-09-25T09:17:00Z")

</div>

JSON3 is great! Currently, I want to use it for the REST API.  
However, I run into one problem with `NaN` in the vector. For one `FloatX` it’s OK 🙂 . See:

```plaintext
julia> struct Foo
        a::Vector{Float64}
        b::Float64
       end

julia> JSON3.StructType(::Type{<:Foo}) = JSON3.Struct()

```

```julia
julia> str = JSON3.write(Foo([NaN, 2.3], NaN), allow_inf=true)
"{\"a\":[NaN,2.3],\"b\":NaN}"

julia> str = JSON3.write([NaN, NaN, 1.1], allow_inf=true)
"[NaN,NaN,1.1]"

julia> str = JSON3.write(NaN, allow_inf=true)
"NaN"

```

 ![nanValid](https://global.discourse-cdn.com/julialang/original/3X/1/e/1e4d1726b78db1212ee575a98064d6103ef520d8.png)  
Thx.

_NOTE_: Too bad this `allow_inf = true` keyword argument is not mentioned in the documentation.
