JSON formatting for multi level tree grid?

I’m trying to create a treegrid with multiple nested levels, as seen in this help page (the page is for filtering, but the example code has the multiple nested rows). However, it needs to be in JSON format.

I’ve already successfully nested rows within one level using:

{
  'rows':[
    {
      'id': '10001',
      'data': [
        {
          'value': 'category'
        },
        ''
      ],
      rows: [
        {
          'id': 'sub_10001',
          'data': [
            'subcategory1',
            'subcategory2'
          ]
        }
      ]
    }
  ]
}

However, when I tried to add a third row, it only displays the rows with ids ‘10001’ and ‘sub_10001’:

{
  'rows':[
    {
      'id': '10001',
      'data': [
        {
          'value': 'category'
        },
        ''
      ],
      rows: [
        {
          'id': 'sub_10001',
          'data': [
            {
              'value': 'subcategory'
            }
          ],
          'rows': [
            {
              'id': 'sub_1000123',
              'data': [
                'sub_subcategory1',
                'sub_subcategory2'
              ]
            }
          ]
        }
      ]
    }
  ]
}

What am I missing? I suspect it’s a problem with the ids, but I can’t seem to find any documentation or examples on this for JSON.

Never mind. The JSON is formatted correctly. It was a minor mistake in another part of the code.