I had some issues with this as well. Last week I was pulling out my hair looking for this solution. There is only documentation on how to parse the hierarchy. I found some patch that had an instance of formatting. Please check out the attached example I made.
I am still working though some of the nuances of formatting these. Today is trying to make an array of objects with the same keys.