DSC icon indicating copy to clipboard operation
DSC copied to clipboard

Refactor code for ConfigSubCommands

Open anmenaga opened this issue 2 years ago • 1 comments

Prerequisites

  • [X] Write a descriptive title.
  • [X] Make sure you are able to repro it on the latest version
  • [X] Search the existing issues.

Steps to reproduce

3 subcomands ConfigSubCommand::Get/Set/Test use copies of mostly the same code; this should be refactored to reuse same piece of code. This was brought up in PR review #82 .

Expected behavior

N/A

Actual behavior

N/A

Error details

No response

Environment data

N/A

Version

N/A

Visuals

No response

anmenaga avatar Jun 15 '23 19:06 anmenaga

I think a viable way to resolve this in general beyond just the 3 cases is for any struct that is intended to be rendered as JSON, we define a to_json trait that is implemented by each struct.

SteveL-MSFT avatar Jun 15 '23 19:06 SteveL-MSFT