File tree Expand file tree Collapse file tree 1 file changed +64
-0
lines changed
src/test/resources/draft7 Expand file tree Collapse file tree 1 file changed +64
-0
lines changed Original file line number Diff line number Diff line change 184
184
"valid" : true
185
185
}
186
186
]
187
+ },
188
+ {
189
+ "description" : " conditions by properties" ,
190
+ "schema" : {
191
+ "type" : " object" ,
192
+ "properties" : {
193
+ "street_address" : {
194
+ "type" : " string"
195
+ },
196
+ "country" : {
197
+ "enum" : [" United States of America" , " Canada" ]
198
+ }
199
+ },
200
+ "if" : {
201
+ "properties" : {
202
+ "country" : {
203
+ "const" : " United States of America"
204
+ }
205
+ }
206
+ },
207
+ "then" : {
208
+ "properties" : {
209
+ "postal_code" : {
210
+ "pattern" : " [0-9]{5}(-[0-9]{4})?"
211
+ }
212
+ }
213
+ },
214
+ "else" : {
215
+ "properties" : {
216
+ "postal_code" : {
217
+ "pattern" : " [A-Z][0-9][A-Z] [0-9][A-Z][0-9]"
218
+ }
219
+ }
220
+ }
221
+ },
222
+ "tests" : [
223
+ {
224
+ "description" : " valid through then" ,
225
+ "data" : {
226
+ "street_address" : " 1600 Pennsylvania Avenue NW" ,
227
+ "country" : " United States of America" ,
228
+ "postal_code" : " 20500"
229
+ },
230
+ "valid" : true
231
+ },
232
+ {
233
+ "description" : " valid through else" ,
234
+ "data" : {
235
+ "street_address" : " 24 Sussex Drive" ,
236
+ "country" : " Canada" ,
237
+ "postal_code" : " K1M 1M4"
238
+ },
239
+ "valid" : true
240
+ },
241
+ {
242
+ "description" : " invalid" ,
243
+ "data" : {
244
+ "street_address" : " 24 Sussex Drive" ,
245
+ "country" : " Canada" ,
246
+ "postal_code" : " 10000"
247
+ },
248
+ "valid" : false
249
+ }
250
+ ]
187
251
}
188
252
]
You can’t perform that action at this time.
0 commit comments