Skip to content

Commit e73d129

Browse files
fduttonFaron Dutton
and
Faron Dutton
authored
Enables validation of json-pointer formats (#760)
Resolves #759 Co-authored-by: Faron Dutton <[email protected]>
1 parent 69555e6 commit e73d129

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

src/main/java/com/networknt/schema/JsonMetaSchema.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ static PatternFormat pattern(String name, String regex) {
8888
COMMON_BUILTIN_FORMATS.add(pattern("style", "\\s*(.+?):\\s*([^;]+);?"));
8989
COMMON_BUILTIN_FORMATS.add(pattern("uuid", "^\\p{XDigit}{8}-\\p{XDigit}{4}-\\p{XDigit}{4}-\\p{XDigit}{4}-\\p{XDigit}{12}$"));
9090
COMMON_BUILTIN_FORMATS.add(pattern("uri-template", "^([^\\p{Cntrl}\"'%<>\\^`\\{|\\}]|%\\p{XDigit}{2}|\\{[+#./;?&=,!@|]?((\\w|%\\p{XDigit}{2})(\\.?(\\w|%\\p{XDigit}{2}))*(:[1-9]\\d{0,3}|\\*)?)(,((\\w|%\\p{XDigit}{2})(\\.?(\\w|%\\p{XDigit}{2}))*(:[1-9]\\d{0,3}|\\*)?))*\\})*$"));
91+
COMMON_BUILTIN_FORMATS.add(pattern("json-pointer", "(/([^/#~]|[~](?=[01]))*)*"));
9192
COMMON_BUILTIN_FORMATS.add(new DateFormat());
9293
COMMON_BUILTIN_FORMATS.add(new EmailFormat());
9394
COMMON_BUILTIN_FORMATS.add(new RegexFormat());

src/test/java/com/networknt/schema/JsonSchemaTestSuiteTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ private void disableV202012Tests() {
8282
this.disabled.add(Paths.get("src/test/suite/tests/draft2020-12/optional/format/idn-hostname.json"));
8383
this.disabled.add(Paths.get("src/test/suite/tests/draft2020-12/optional/format/iri-reference.json"));
8484
this.disabled.add(Paths.get("src/test/suite/tests/draft2020-12/optional/format/iri.json"));
85-
this.disabled.add(Paths.get("src/test/suite/tests/draft2020-12/optional/format/json-pointer.json"));
8685
this.disabled.add(Paths.get("src/test/suite/tests/draft2020-12/optional/format/relative-json-pointer.json"));
8786
this.disabled.add(Paths.get("src/test/suite/tests/draft2020-12/optional/format/uri-reference.json"));
8887
this.disabled.add(Paths.get("src/test/suite/tests/draft2020-12/ref.json"));
@@ -100,7 +99,6 @@ private void disableV201909Tests() {
10099
this.disabled.add(Paths.get("src/test/suite/tests/draft2019-09/optional/format/idn-hostname.json"));
101100
this.disabled.add(Paths.get("src/test/suite/tests/draft2019-09/optional/format/iri-reference.json"));
102101
this.disabled.add(Paths.get("src/test/suite/tests/draft2019-09/optional/format/iri.json"));
103-
this.disabled.add(Paths.get("src/test/suite/tests/draft2019-09/optional/format/json-pointer.json"));
104102
this.disabled.add(Paths.get("src/test/suite/tests/draft2019-09/optional/format/relative-json-pointer.json"));
105103
this.disabled.add(Paths.get("src/test/suite/tests/draft2019-09/optional/format/uri-reference.json"));
106104
this.disabled.add(Paths.get("src/test/suite/tests/draft2019-09/recursiveRef.json"));
@@ -119,7 +117,6 @@ private void disableV7Tests() {
119117
this.disabled.add(Paths.get("src/test/suite/tests/draft7/optional/format/idn-hostname.json"));
120118
this.disabled.add(Paths.get("src/test/suite/tests/draft7/optional/format/iri-reference.json"));
121119
this.disabled.add(Paths.get("src/test/suite/tests/draft7/optional/format/iri.json"));
122-
this.disabled.add(Paths.get("src/test/suite/tests/draft7/optional/format/json-pointer.json"));
123120
this.disabled.add(Paths.get("src/test/suite/tests/draft7/optional/format/relative-json-pointer.json"));
124121
this.disabled.add(Paths.get("src/test/suite/tests/draft7/optional/format/uri-reference.json"));
125122
this.disabled.add(Paths.get("src/test/suite/tests/draft7/ref.json"));
@@ -129,7 +126,6 @@ private void disableV7Tests() {
129126
private void disableV6Tests() {
130127
this.disabled.add(Paths.get("src/test/suite/tests/draft6/optional/float-overflow.json"));
131128
this.disabled.add(Paths.get("src/test/suite/tests/draft6/optional/format.json"));
132-
this.disabled.add(Paths.get("src/test/suite/tests/draft6/optional/format/json-pointer.json"));
133129
this.disabled.add(Paths.get("src/test/suite/tests/draft6/optional/format/uri-reference.json"));
134130
this.disabled.add(Paths.get("src/test/suite/tests/draft6/ref.json"));
135131
this.disabled.add(Paths.get("src/test/suite/tests/draft6/refRemote.json"));

0 commit comments

Comments
 (0)