I have a struct which I am trying to save as a JSON. I would like to exclude one of its fields. StructTypes.excludes seems like the proper way to do this, but I getting the below error when using it. What might be going wrong?
MRE
using JSON3
mutable struct example_struct
x
y
z
example_struct() = new(1,2,3)
end
StructTypes.StructType(::Type{example_struct}) = StructTypes.Mutable()
StructTypes.excludes(::Type{example_struct}) = (:x)
ex = example_struct()
JSON3.write(ex)
I have a struct which I am trying to save as a JSON. I would like to exclude one of its fields.
StructTypes.excludes
seems like the proper way to do this, but I getting the below error when using it. What might be going wrong?MRE