I'm elaborating on the processing shown in the documentation here: https://plantuml.com/preprocessing-json#fe16b3bc321e147d (Self-descriptive example, in the JSON-preprocessing section) and I wondered if it would be possible to allow functions to call themselves? I would allow something like the following to work better:
In the working code above, the function: $sys_diagram calls a copy/pasted (with a different name: $sys_diagram_sub) function, that in turn calls the original function ($sys_diagram) which therefor can loop as many times as required to build the desired diagram depth - i didn't expect that to work, I'll be honest, but the system errors when you simply call the $sys_diagram function from within itself. It would be nice to remove the duplication.