1+ [
2+ {
3+ "description" : " base URI change - change folder" ,
4+ "schema" : {
5+ "id" : " http://localhost:1234/scope_change_defs1.json" ,
6+ "type" : " object" ,
7+ "properties" : {
8+ "list" : {
9+ "$ref" : " #/definitions/baz"
10+ }
11+ },
12+ "definitions" : {
13+ "baz" : {
14+ "id" : " folder/" ,
15+ "type" : " array" ,
16+ "items" : {
17+ "$ref" : " folderInteger.json"
18+ }
19+ }
20+ }
21+ },
22+ "tests" : [
23+ {
24+ "description" : " number is valid" ,
25+ "data" : {
26+ "list" : [
27+ 1
28+ ]
29+ },
30+ "valid" : true
31+ },
32+ {
33+ "description" : " string is invalid" ,
34+ "data" : {
35+ "list" : [
36+ " a"
37+ ]
38+ },
39+ "valid" : false
40+ }
41+ ]
42+ },
43+ {
44+ "description" : " base URI change - change folder in subschema" ,
45+ "schema" : {
46+ "id" : " http://localhost:1234/scope_change_defs2.json" ,
47+ "type" : " object" ,
48+ "properties" : {
49+ "list" : {
50+ "$ref" : " #/definitions/baz/definitions/bar"
51+ }
52+ },
53+ "definitions" : {
54+ "baz" : {
55+ "id" : " folder/" ,
56+ "definitions" : {
57+ "bar" : {
58+ "type" : " array" ,
59+ "items" : {
60+ "$ref" : " folderInteger.json"
61+ }
62+ }
63+ }
64+ }
65+ }
66+ },
67+ "tests" : [
68+ {
69+ "description" : " number is valid" ,
70+ "data" : {
71+ "list" : [
72+ 1
73+ ]
74+ },
75+ "valid" : true
76+ },
77+ {
78+ "description" : " string is invalid" ,
79+ "data" : {
80+ "list" : [
81+ " a"
82+ ]
83+ },
84+ "valid" : false
85+ }
86+ ]
87+ },
88+ {
89+ "description" : " root ref in remote ref" ,
90+ "schema" : {
91+ "id" : " http://localhost:1234/object" ,
92+ "type" : " object" ,
93+ "properties" : {
94+ "name" : {
95+ "$ref" : " name.json#/definitions/orNull"
96+ }
97+ }
98+ },
99+ "tests" : [
100+ {
101+ "description" : " string is valid" ,
102+ "data" : {
103+ "name" : " foo"
104+ },
105+ "valid" : true
106+ },
107+ {
108+ "description" : " null is valid" ,
109+ "data" : {
110+ "name" : null
111+ },
112+ "valid" : true
113+ },
114+ {
115+ "description" : " object is invalid" ,
116+ "data" : {
117+ "name" : {
118+ "name" : null
119+ }
120+ },
121+ "valid" : false
122+ }
123+ ]
124+ },
125+ {
126+ "description" : " indirect ref within remote ref" ,
127+ "schema" : {
128+ "$ref" : " http://localhost:1234/subSchemas.json#/indirectRefToInteger"
129+ },
130+ "tests" : [
131+ {
132+ "description" : " indirect ref within ref valid" ,
133+ "data" : 1 ,
134+ "valid" : true
135+ },
136+ {
137+ "description" : " indirect ref within ref invalid" ,
138+ "data" : " a" ,
139+ "valid" : false
140+ }
141+ ]
142+ },
143+ {
144+ "description" : " external ref within remote ref" ,
145+ "schema" : {
146+ "$ref" : " http://localhost:1234/subSchemas.json#/refToExternalInteger"
147+ },
148+ "tests" : [
149+ {
150+ "description" : " external ref within ref valid" ,
151+ "data" : 1 ,
152+ "valid" : true
153+ },
154+ {
155+ "description" : " external ref within ref invalid" ,
156+ "data" : " a" ,
157+ "valid" : false
158+ }
159+ ]
160+ },
161+ {
162+ "schema" : {
163+ "$ref" : " http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
164+ },
165+ "tests" : [
166+ {
167+ "description" : " valid against remote schema" ,
168+ "data" : 1 ,
169+ "valid" : true
170+ },
171+ {
172+ "description" : " valid against remote schema" ,
173+ "data" : -1 ,
174+ "valid" : false
175+ }
176+ ]
177+ }
178+ ]
0 commit comments