winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit e9f5f3bfc4037f34e0cf59f019de1a00028cd12b
parent bdd2cabbe07725e4ab8f8ecbb673bc1cebff36cb
Author: AmirMS <104940545+AmelBawa-msft@users.noreply.github.com>
Date:   Fri,  9 May 2025 00:05:32 -0700

Ignore comments when writing JSON output in WinGet DSC v3 resources (#5445)

<!-- To check a checkbox place an "x" between the brackets. e.g: [x] -->

- [ ] I have signed the [Contributor License
Agreement](https://cla.opensource.microsoft.com/microsoft/winget-pkgs).
- [ ] This pull request is related to an issue.

-----

###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/microsoft/winget-cli/pull/5445)
Diffstat:
Msrc/AppInstallerCLICore/Commands/DscCommandBase.cpp | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/AppInstallerCLICore/Commands/DscCommandBase.cpp b/src/AppInstallerCLICore/Commands/DscCommandBase.cpp @@ -307,6 +307,8 @@ namespace AppInstaller::CLI { Json::StreamWriterBuilder writerBuilder; writerBuilder.settings_["indentation"] = ""; + writerBuilder.settings_["commentStyle"] = "None"; + writerBuilder.settings_["emitUTF8"] = true; context.Reporter.Json() << Json::writeString(writerBuilder, value) << std::endl; } }