File tree Expand file tree Collapse file tree 3 files changed +54
-0
lines changed
java/com/networknt/schema
resources/tests/id_schema Expand file tree Collapse file tree 3 files changed +54
-0
lines changed Original file line number Diff line number Diff line change @@ -259,5 +259,10 @@ public void testTypeValidator() throws Exception {
259
259
public void testUniqueItemsValidator () throws Exception {
260
260
runTestFile ("tests/uniqueItems.json" );
261
261
}
262
+
263
+ @ Test
264
+ public void testIdSchemaWithUrl () throws Exception {
265
+ runTestFile ("tests/id_schema/property.json" );
266
+ }
262
267
263
268
}
Original file line number Diff line number Diff line change
1
+ [
2
+ {
3
+ "description" : " id as schema" ,
4
+ "schema" : {
5
+ "id" : " http://localhost:1234/id_schema/schema/features.json" ,
6
+ "title" : " property object" ,
7
+ "type" : " object" ,
8
+ "properties" : {
9
+ "featuresInteger" : {
10
+ "$ref" : " #/featuresInteger"
11
+ },
12
+ "featuresBoolean" : {
13
+ "$ref" : " #/featuresBoolean"
14
+ }
15
+ },
16
+ "additionalProperties" : false
17
+ },
18
+ "tests" : [
19
+ {
20
+ "data" : {
21
+ "featuresInteger" : 4 ,
22
+ "featuresBoolean" : true
23
+ },
24
+ "valid" : true
25
+ },
26
+ {
27
+ "data" : {
28
+ "featuresInteger" : 4.0 ,
29
+ "featuresBoolean" : true
30
+ },
31
+ "valid" : false
32
+ }
33
+ ]
34
+ }
35
+ ]
Original file line number Diff line number Diff line change
1
+ {
2
+ "$schema" : " http://json-schema.org/draft-04/schema#" ,
3
+ "title" : " features fields" ,
4
+ "featuresBoolean" : {
5
+ "title" : " boolean feature" ,
6
+ "type" : " boolean"
7
+ },
8
+ "featuresInteger" : {
9
+ "title" : " integer feature" ,
10
+ "type" : " integer" ,
11
+ "minimum" : 1 ,
12
+ "maximum" : 99999
13
+ }
14
+ }
You can’t perform that action at this time.
0 commit comments