monkey365 icon indicating copy to clipboard operation
monkey365 copied to clipboard

Ability to expand the JSON depth limit beyond 10

Open localneeds opened this issue 10 months ago • 2 comments

Is your feature request related to a problem? Please describe. Yes. After successfully completing a scan targeted at a specific Azure subscription. The export parameter was ExportTo = 'HTML'. After the scan process completes error-free the following message appears: WARNING: Resulting JSON is truncated as serialization has exceeded the set depth of 10.

This message is typically related to either the ConvertTo-Json or ConvertFrom-Json PowerShell commands. I ran my Azure scan with WriteLog = $true parameter and found nothing in the resulting log that clearly corresponded to this warning. The only suspect was several instances of this being logged:

[Convert-RawData] - Conversion from JSON failed with error: Unexpected character encountered while parsing value: <. Path '', line 0, position 0. - verbose

The message in the console after the scan was only a warning (not an error). But there is still a concern is that the final output is missing data due to this truncation.

Describe the solution you'd like I would like to be able to declare a higher depth limit. This is a native with the ConvertTo-Json & ConvertFrom-Json cmdlets via the -Depth parameter

Describe alternatives you've considered Since I cannot find any corresponding entry in the logs for this specific message, alternative actions are very limited. Short of fully executing the various module functions one at a time, I am unsure what, if any, workarounds are possible.

Additional context json-truncation-message

localneeds avatar Apr 24 '24 23:04 localneeds