File tree Expand file tree Collapse file tree 3 files changed +44
-0
lines changed
java/com/networknt/schema
resources/tests/classpath Expand file tree Collapse file tree 3 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -274,4 +274,9 @@ public void testIdSchemaWithUrl() throws Exception {
274
274
runTestFile ("tests/id_schema/property.json" );
275
275
}
276
276
277
+ @ Test
278
+ public void testSchemaFromClasspath () throws Exception {
279
+ runTestFile ("tests/classpath/schema.json" );
280
+ }
281
+
277
282
}
Original file line number Diff line number Diff line change
1
+ [
2
+ {
3
+ "description" : " Sub schema in classpath" ,
4
+ "schema" : {
5
+ "id" : " classpath:/tests/classpath/sub-schema.json" ,
6
+ "type" : " object" ,
7
+ "properties" : {
8
+ "features" : {
9
+ "$ref" : " #/features"
10
+ }
11
+ },
12
+ "additionalProperties" : false
13
+ },
14
+ "tests" : [
15
+ {
16
+ "data" : {
17
+ "features" : 4
18
+ },
19
+ "valid" : true
20
+ },
21
+ {
22
+ "data" : {
23
+ "features" : 4.0
24
+ },
25
+ "valid" : false
26
+ }
27
+ ]
28
+ }
29
+ ]
Original file line number Diff line number Diff line change
1
+ {
2
+ "$schema" : " http://json-schema.org/draft-04/schema#" ,
3
+ "title" : " features" ,
4
+ "features" : {
5
+ "title" : " integer feature" ,
6
+ "type" : " integer" ,
7
+ "minimum" : 1 ,
8
+ "maximum" : 99999
9
+ }
10
+ }
You can’t perform that action at this time.
0 commit comments