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:
julia> struct Foo
a::Vector{Float64}
b::Float64
end
julia> JSON3.StructType(::Type{<:Foo}) = JSON3.Struct()
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"
Thx.
NOTE: Too bad this allow_inf = true
keyword argument is not mentioned in the documentation.