Strapping.jl
Strapping.jl copied to clipboard
Support UnorderedStruct
xref https://github.com/quinnj/JSON3.jl/pull/113 & https://github.com/JuliaData/StructTypes.jl/pull/35/
I think Strapping should follow the behavior of JSON3 with respect to Ordered / Unordered? Simple repro below
import StructTypes
import Strapping
struct Person
name::String
id::Int
end
StructTypes.StructType(::Type{Person}) = StructTypes.UnorderedStruct() # aka StructTypes.Struct()
julia> Strapping.construct(Person, [(; name="Bob", id=1)])
Person("Bob", 1)
julia> Strapping.construct(Person, [(; id=1, name="Bob")])
ERROR: MethodError: no method matching String(::Int64)