JSON3.jl struct read

I can think of two options;

  1. You could define a quick wrapper struct:
mutable struct Wrapper
    b::Foo
    Wrapper() = new()
end
StructTypes.StructType(::Type{Wrapper}) = StructTypes.Mutable()

JSON3.read(json, Wrapper)
  1. The StructTypes.jl package has a utility function called StructTypes.constructfrom(T, obj), that could be used in your case like:
foo = StructTypes.constructfrom(Foo, JSON3.read(json)["b"])

Basically, it allows using the StructType information for T to extract the properties from any AbstractDict provided, which JSON3.Object satisfies.