File tree 1 file changed +51
-0
lines changed
1 file changed +51
-0
lines changed Original file line number Diff line number Diff line change 130
130
"valid" : true
131
131
}
132
132
]
133
+ },
134
+ {
135
+ "description" : " $recursiveRef with $recursiveAnchor: false works like $ref" ,
136
+ "schema" : {
137
+ "$id" : " http://localhost:4242/recursiveRef4/schema.json" ,
138
+ "$recursiveAnchor" : false ,
139
+ "$defs" : {
140
+ "myobject" : {
141
+ "$id" : " myobject.json" ,
142
+ "$recursiveAnchor" : false ,
143
+ "anyOf" : [
144
+ { "type" : " string" },
145
+ {
146
+ "type" : " object" ,
147
+ "additionalProperties" : { "$recursiveRef" : " #" }
148
+ }
149
+ ]
150
+ }
151
+ },
152
+ "anyOf" : [
153
+ { "type" : " integer" },
154
+ { "$ref" : " #/$defs/myobject" }
155
+ ]
156
+ },
157
+ "tests" : [
158
+ {
159
+ "description" : " integer matches at the outer level" ,
160
+ "data" : 1 ,
161
+ "valid" : true
162
+ },
163
+ {
164
+ "description" : " single level match" ,
165
+ "data" : { "foo" : " hi" },
166
+ "valid" : true
167
+ },
168
+ {
169
+ "description" : " integer does not match as a property value" ,
170
+ "data" : { "foo" : 1 },
171
+ "valid" : false
172
+ },
173
+ {
174
+ "description" : " two levels, properties match with inner definition" ,
175
+ "data" : { "foo" : { "bar" : " hi" } },
176
+ "valid" : true
177
+ },
178
+ {
179
+ "description" : " two levels, integer does not match as a property value" ,
180
+ "data" : { "foo" : { "bar" : 1 } },
181
+ "valid" : false
182
+ }
183
+ ]
133
184
}
134
185
]
You can’t perform that action at this time.
0 commit comments