StructArrays and custom data layout

Hello fine fellows!

I’m trying to use StructArrays for a custom data layout. Basically, I would like the following to produce a StructArray that includes the parameters field:

using StructArrays
struct MyStruct

struct MyData

p = [1,2]
p2 = [3,4]
s1 = MyStruct(Dict(:MyData => MyData(p)))
s2 = MyStruct(Dict(:MyData => MyData(p2)))

StructArray([s1, s2])

If done naively like above, it does not include the parameters field

I know that I have to overload the getproperty(ms::MyStruct) function and then overload the StructArrays.staticschema and StructArrays.createinstance (example here) functions in order for StructArrays to include the parameters field.

Can anyone point me in the right direction?
Thanks! /Robin