Closed anlumithe closed 2 years ago
It looks like the generated type is missing that results
is a vector. I'll dig into this later.
module JSONTypes
import StructTypes
mutable struct Result
object::String
name::String
Result() = new()
end
mutable struct Root
object::String
date::Union{Nothing, String}
results::Union{Nothing, Result}
Root() = new()
end
StructTypes.StructType(::Type{Result}) = StructTypes.Mutable()
StructTypes.StructType(::Type{Root}) = StructTypes.Mutable()
end # module
When generating a type of multiple JSON strings with different structure, reading a JSON string of one specific structure fails with an error
invalid JSON
. A minimal example:Is there a possibility to generate one type out of two different JSON strings, so that both JSON string structures can be read?