File tree 4 files changed +32
-0
lines changed
tests/examples/conditional
4 files changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "type" : " object" ,
3
+ "properties" : {
4
+ "street_address" : {
5
+ "type" : " string"
6
+ },
7
+ "country" : {
8
+ "default" : " United States of America" ,
9
+ "enum" : [" United States of America" , " Canada" ]
10
+ }
11
+ },
12
+ "if" : {
13
+ "properties" : { "country" : { "const" : " United States of America" } }
14
+ },
15
+ "then" : {
16
+ "properties" : { "postal_code" : { "pattern" : " [0-9]{5}(-[0-9]{4})?" } }
17
+ },
18
+ "else" : {
19
+ "properties" : { "postal_code" : { "pattern" : " [A-Z][0-9][A-Z] [0-9][A-Z][0-9]" } }
20
+ }
21
+ }
Original file line number Diff line number Diff line change
1
+ data.postal_code must match pattern [A-Z][0-9][A-Z] [0-9][A-Z][0-9]
Original file line number Diff line number Diff line change
1
+ {
2
+ "street_address" : " 24 Sussex Drive" ,
3
+ "country" : " Canada" ,
4
+ "postal_code" : " 10000"
5
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "street_address" : " 1600 Pennsylvania Avenue NW" ,
3
+ "country" : " United States of America" ,
4
+ "postal_code" : " 20500"
5
+ }
You can’t perform that action at this time.
0 commit comments