mirror of
https://github.com/ScoopInstaller/Scoop.git
synced 2025-12-12 02:56:03 +00:00
supporting: Update Newtonsoft.Json to 11.0.2, Newtonsoft.Json.Schema to 3.0.10 (#3043)
- Update supporting\validator\bin\Newtonsoft.Json to 11.0.2 - **HIGHLIGHT**: support for regex operator in JSON Paths - Latest Newtonsoft.Json version is 12.0.1, which has some compatibility issues with Json.Schema 3.0.10 and PowerShell Core 6.1.12 (On my PC) - Update supporting\validator\bin\Newtonsoft.Json.Schema to 3.0.10 - Use .NET 4.5 instead of .NET 4.0, since Scoop's requirements is [.NET Framework 4.5+](https://github.com/lukesampson/scoop#requirements) - Modify `json_path()` to escape `$version` substitutions when `$jsonpath` has regex **EXAMPLE OF JPATH REGEX** ```json "checkver": { "url": "https://dist.nuget.org/index.json", "jp": "$..versions[?(@.displayName =~ /.*recommended.*/)].version" } ```
This commit is contained in:
committed by
Richard Kuhnt
parent
28f74572a6
commit
03ebcc2984
@@ -95,7 +95,7 @@ function ConvertToPrettyJson {
|
||||
function json_path([String] $json, [String] $jsonpath, [Hashtable] $substitutions) {
|
||||
Add-Type -Path "$psscriptroot\..\supporting\validator\bin\Newtonsoft.Json.dll"
|
||||
if ($null -ne $substitutions) {
|
||||
$jsonpath = substitute $jsonpath $substitutions
|
||||
$jsonpath = substitute $jsonpath $substitutions ($jsonpath -like "*=~*")
|
||||
}
|
||||
try {
|
||||
$obj = [Newtonsoft.Json.Linq.JObject]::Parse($json)
|
||||
|
||||
Reference in New Issue
Block a user