Best design for product attributes

I already a mapping template, what I want to know is what it should look like if I want to achieve dynamic types, preferably a nested type for the attributes then automatically generate the key values dynamically with the proper inferred types.