Skip to content

Ensure all errors are returned for Test-Json with List output format - #28273

Merged
Dongbo Wang (daxian-dbw) merged 1 commit into
PowerShell:release/v7.6.10from
anamnavi:testjson-outputformat
Oct 28, 2026
Merged

Dongbo Wang (daxian-dbw) merged 1 commit into
PowerShell:release/v7.6.10from
anamnavi:testjson-outputformat

Conversation

@anamnavi

@anamnavi Anam Navied (anamnavi) commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

PR Summary

This pull request makes a small but important change to the default output format used in the TestJsonCommand class. The output format for JSON evaluation has been switched from hierarchical to list format to better suit the intended use case for 7.6.

  • Changed the default OutputFormat in the BeginProcessing method of TestJsonCommand from Hierarchical to List (src/Microsoft.PowerShell.Commands.Utility/commands/utility/TestJsonCommand.cs) as OutputFormat.Hierarchical is supported for 7.7+ only.

PR Context

Resolves #28218 #28245

PR Checklist

Copilot AI balanced review requested due to automatic review settings October 28, 2026 16:18
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@anamnavi Anam Navied (anamnavi) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Oct 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the switch to list-format JSON schema evaluation.

No open issues 🎉

What changed in this PR

Updates Test-Json to use list-format schema evaluation for PowerShell 7.6, aiming to return all validation errors without relying on hierarchical output support intended for 7.7+.

Changes:

  • Changes EvaluationOptions.OutputFormat from Hierarchical to List in BeginProcessing.
File Description
src/​Microsoft.PowerShell.Commands.Utility/​commands/​utility/​TestJsonCommand.cs Switches JSON schema evaluation to list output.

Review effort: Balanced

@daxian-dbw

Dongbo Wang (daxian-dbw) commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Anam Navied (@anamnavi) Please add fix #<issue-number> in the PR description, so the issue can be resolved properly when you merge the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants