Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to expand the JSON depth limit beyond 10 #97

Open
localneeds opened this issue Apr 24, 2024 · 1 comment
Open

Ability to expand the JSON depth limit beyond 10 #97

localneeds opened this issue Apr 24, 2024 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@localneeds
Copy link

localneeds commented Apr 24, 2024

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 localneeds added enhancement New feature or request status/needs-triage Needs triage labels Apr 24, 2024
@silverhack
Copy link
Owner

Hi @localneeds,

Firstly, thank you for the detailed report. It's really appreciated. I can confirm that it's a bug and will be fixed shortly. I'm currently working in improvements for JSON,CSV and HTML outputs.

As you mention, there is an issue with large json objects and when depth flag is not set. There are some discussions within the PowerShell Github about that.

I'll investigate it and I will let you know once a patch is available.

Many thanks for your report and for using Monkey365.
Cheers,

@silverhack silverhack added bug Something isn't working good first issue Good for newcomers and removed enhancement New feature or request status/needs-triage Needs triage labels Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants