-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds json formatter to variable get (#163)
- Loading branch information
1 parent
3584891
commit 09f43d8
Showing
9 changed files
with
27 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/Confix.Tool/src/Confix.Library/Output/JsonNodeOutputFormatter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System.Text.Json.Nodes; | ||
using Confix.Tool.Commands.Logging; | ||
using Confix.Tool.Reporting; | ||
|
||
namespace Confix.Tool.Commands.Configuration; | ||
|
||
public sealed class JsonNodeOutputFormatter : IOutputFormatter<JsonNode> | ||
{ | ||
/// <inheritdoc /> | ||
public bool CanHandle(OutputFormat format, JsonNode value) | ||
=> format == OutputFormat.Json; | ||
|
||
/// <inheritdoc /> | ||
public Task<string> FormatAsync(OutputFormat format, JsonNode value) | ||
{ | ||
return Task.FromResult(value.ToJsonString()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,3 +67,4 @@ | |
} | ||
] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,3 +88,4 @@ | |
} | ||
] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,3 +93,4 @@ | |
} | ||
} | ||
} | ||
|
46 changes: 0 additions & 46 deletions
46
...positories/__snapshots__/__mismatch__/RuntimeConfigurationTests.Parse_Should_BeValid.snap
This file was deleted.
Oops, something went wrong.
101 changes: 0 additions & 101 deletions
101
...ismatch__/GraphQLDependencyReportingTests.Should_OutputDependency_When_MultipleMatch.snap
This file was deleted.
Oops, something went wrong.