When calling API REST endpoint endless loop is experienced

Product: PowerShell Universal
Version: 2.4.1

I have tried using your PowerShell Universal, and specifically the API Endpoint.

If I run the Endpoint from the Endpoint page, there is an endless loop and RAM usage grows.

Here is the actual script:

function IncludeTrailingPathDelimiter
{
  param([string]$Value)
  if ($Value.EndsWith('\')) {$Value} else {$Value + '\'}
}
$SvnRoot = "C:\SVN\Home\HD-Docs\MkDocsProjects\"
$WebRoot = "C:\tools\nginx\html_startsite\"
Get-ChildItem "C:\SVN\Home\HD-Docs\MkDocsProjects\" -Directory

If I press the Run button in the Output pane, there is an endless loop as described.
I went to lunch and when I got back it had grown to 18 GB Ram usage.

I have just only started using your tool, so I may be doing something wrong?

This is typically a problem with serialization. We use ConvertTo-Json internally and it can have problems serializing large objects. The default depth is set to the max (100), so you could try to reduce the depth.

Get-ChildItem "C:\SVN\Home\HD-Docs\MkDocsProjects\" -Directory | ConvertTo-Json -Depth 1