-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Test-Json: Use JsonSchema.Net (System.Text.Json) instead of NJsonSchema (Newtonsoft.Json) #18141
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
Merged
iSazonov
merged 59 commits into
PowerShell:master
from
gregsdennis:update-test-json-to-use-jsonschema.net
May 4, 2023
Merged
Changes from all commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
50def0b
updated Test-Json cmdlet to use JsonSchema.Net instead of NJsonSchema
gregsdennis 3fd0a8a
change quoting of test-json tests
gregsdennis 95241e8
adjust brace spacing to match examples in other commands
gregsdennis 61f2dbd
remove space between closing curly brace and closing parenthesis
gregsdennis 135f06a
configure for automatic downloads of external schemas
gregsdennis 42592b5
use single quote strings when writing literal JSON values
gregsdennis ae5b85e
Update test/powershell/Modules/Microsoft.PowerShell.Utility/Test-Json…
iSazonov 0fb4eb1
detect validation failures and report errors better
gregsdennis 6e332eb
capture deserialization exception and record as failure to read ref'd…
gregsdennis ed4cdf0
remove component ids for pdb files from .wxs file
gregsdennis beb23b7
remove unused usings; add comment regarding json exception during val…
gregsdennis a571f08
add schema resolution exception; wrap fetch exceptions in new excepti…
gregsdennis 115919e
use WriteError instead of throwing exception
gregsdennis 42381a3
fix xml comments
gregsdennis 0d1cca7
Update src/Microsoft.PowerShell.Commands.Utility/commands/utility/Jso…
gregsdennis 3e79360
Update src/Microsoft.PowerShell.Commands.Utility/commands/utility/Tes…
gregsdennis 8719102
use single-line method call; remove unused usings
gregsdennis ae3eb4d
enable nullable refs in JsonSchemaReferenceResolutionException.cs
gregsdennis cbc0d0b
move error string to resource file
gregsdennis ec7b35e
updated message construction to use resources for localization support
gregsdennis 3b9bd80
Replace DllImport with LibraryImport in SMA 5 (#18580)
iSazonov 9c43f51
updated Test-Json cmdlet to use JsonSchema.Net instead of NJsonSchema
gregsdennis b1f3d6a
adjust brace spacing to match examples in other commands
gregsdennis 26faded
remove space between closing curly brace and closing parenthesis
gregsdennis 097b11b
configure for automatic downloads of external schemas
gregsdennis 8aaef47
use single quote strings when writing literal JSON values
gregsdennis e240b37
Update test/powershell/Modules/Microsoft.PowerShell.Utility/Test-Json…
iSazonov 639ea31
detect validation failures and report errors better
gregsdennis 6a385e1
capture deserialization exception and record as failure to read ref'd…
gregsdennis db20b2a
remove component ids for pdb files from .wxs file
gregsdennis 467f049
remove unused usings; add comment regarding json exception during val…
gregsdennis 51aea5a
add schema resolution exception; wrap fetch exceptions in new excepti…
gregsdennis 843136b
use WriteError instead of throwing exception
gregsdennis edfc4b6
fix xml comments
gregsdennis df7cc4d
Update src/Microsoft.PowerShell.Commands.Utility/commands/utility/Jso…
gregsdennis 0cb49d0
Update src/Microsoft.PowerShell.Commands.Utility/commands/utility/Tes…
gregsdennis 31de5b6
use single-line method call; remove unused usings
gregsdennis 6214b07
enable nullable refs in JsonSchemaReferenceResolutionException.cs
gregsdennis 5005a3f
move error string to resource file
gregsdennis 42f8b70
remove extra whitespace
SteveL-MSFT 1ab6957
upated jsonschema.net package version
gregsdennis 8380399
add error message without parameters; add comment for fetch method; d…
gregsdennis 11380a1
remove whitespace
gregsdennis b8beee2
remove other extra whitespace; revert http to https
gregsdennis d847444
one last space
gregsdennis f17e245
update test-json tests for new message key
gregsdennis 18ce041
fix typo on error message key
gregsdennis 614e5cd
fix typo on error message key (actually, this time)
gregsdennis 3e4594c
update package bom files
gregsdennis ecf5522
Update windows.json
TravisEz13 f6a1838
Merge branch 'master' into update-test-json-to-use-jsonschema.net
gregsdennis 1fa1164
Remove an extra space in `TestJsonCmdletStrings.resx`
daxian-dbw 6bb8baf
incorporate changes that allow better console output of errors
gregsdennis dc9200b
reintroduce changes from #19042 missed by faulty merge
gregsdennis 4597c4d
Restore a newline to fix a CodeFactor issue
daxian-dbw a305b1c
Remove unused resource string
daxian-dbw 7ba5026
move json parsing outside of try/catch so that it can throw its own e…
gregsdennis 10182de
update tests to expect the correct error
gregsdennis 654ae11
add missing variables to pester tests
gregsdennis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
27 changes: 27 additions & 0 deletions
27
...ft.PowerShell.Commands.Utility/commands/utility/JsonSchemaReferenceResolutionException.cs
This file contains hidden or 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,27 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| #nullable enable | ||
|
|
||
| using System; | ||
|
|
||
| namespace Microsoft.PowerShell.Commands; | ||
|
|
||
| /// <summary> | ||
| /// Thrown during evaluation of <see cref="TestJsonCommand"/> when an attempt | ||
| /// to resolve a <code>$ref</code> or <code>$dynamicRef</code> fails. | ||
| /// </summary> | ||
| internal class JsonSchemaReferenceResolutionException : Exception | ||
| { | ||
| /// <summary> | ||
| /// Initializes a new instance of the <see cref="JsonSchemaReferenceResolutionException"/> class. | ||
| /// </summary> | ||
| /// <param name="innerException"> | ||
| /// The exception that is the cause of the current exception, or a null reference | ||
| /// (<code>Nothing</code> in Visual Basic) if no inner exception is specified. | ||
| /// </param> | ||
| public JsonSchemaReferenceResolutionException(Exception innerException) | ||
| : base(message: null, innerException) | ||
| { | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.