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

Deep structures cause warning when using Lookup or Get-DatumRsop #136

Open
cibboy opened this issue Feb 8, 2024 · 0 comments
Open

Deep structures cause warning when using Lookup or Get-DatumRsop #136

cibboy opened this issue Feb 8, 2024 · 0 comments

Comments

@cibboy
Copy link

cibboy commented Feb 8, 2024

Due to the default depth of 2 for ConvertTo-Json, functions Invoke-TestHandlerAction, Merge-Datum and Merge-HashTable may write warning "Resulting JSON is truncated as serialization has exceeded the set depth of 2" when using deep structures. Try, for example:

Configurations:
- Test

Test:
  Depth1:
    Depth2:
      Depth3:
        Array:
        - value1
        - value2

The warning is shown even if -Debug or -Verbose are not used, since Powershell solves the command inside the string before checking whether such string has to follow the proper stream.

I suggest either using -Depth 10 (seems a reasonable depth without killing performance) or perhaps using the depth specified in $Datum.__Definition.default_lookup_options.

I'm available to create a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant