Skip to content

Commit 92c89f8

Browse files
authored
build(schema): Add explicit escape to opening bracket matcher in jp/jsonpath regex (#3719)
1 parent cabaf59 commit 92c89f8

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
- **checkver:** Fix output with '-Version' ([#3774](https://github.com/ScoopInstaller/Scoop/issues/3774))
2020
- **schema:** Add '$schema' property ([#4623](https://github.com/ScoopInstaller/Scoop/issues/4623))
21+
- **schema:** Add explicit escape to opening bracket matcher in jp/jsonpath regex ([#3719](https://github.com/ScoopInstaller/Scoop/issues/3719))
2122

2223
### Styles
2324

schema.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
"pattern": "^([a-fA-F0-9]{64}|(sha1|sha256|sha512|md5):([a-fA-F0-9]{32}|[a-fA-F0-9]{40}|[a-fA-F0-9]{64}|[a-fA-F0-9]{128}))$",
88
"type": "string"
99
},
10+
"jsonPathPattern": {
11+
"pattern": "^\\$[.\\[].*$",
12+
"type": "string"
13+
},
1014
"hash": {
1115
"anyOf": [
1216
{
@@ -35,13 +39,11 @@
3539
"type": "string"
3640
},
3741
"jp": {
38-
"pattern": "^\\$[.[].*$",
39-
"type": "string",
42+
"$ref": "#/definitions/jsonPathPattern",
4043
"description": "Same as 'jsonpath'"
4144
},
4245
"jsonpath": {
43-
"pattern": "^\\$[.[].*$",
44-
"type": "string"
46+
"$ref": "#/definitions/jsonPathPattern"
4547
},
4648
"xpath": {
4749
"type": "string"
@@ -284,13 +286,11 @@
284286
"type": "string"
285287
},
286288
"jp": {
287-
"pattern": "^\\$[.[].*$",
288-
"type": "string",
289+
"$ref": "#/definitions/jsonPathPattern",
289290
"description": "Same as 'jsonpath'"
290291
},
291292
"jsonpath": {
292-
"pattern": "^\\$[.[].*$",
293-
"type": "string"
293+
"$ref": "#/definitions/jsonPathPattern"
294294
},
295295
"xpath": {
296296
"type": "string"

0 commit comments

Comments
 (0)