File tree Expand file tree Collapse file tree 6 files changed +246
-0
lines changed Expand file tree Collapse file tree 6 files changed +246
-0
lines changed Original file line number Diff line number Diff line change 64
64
"valid" : false
65
65
}
66
66
]
67
+ },
68
+ {
69
+ "description" : " anyOf complex types" ,
70
+ "schema" : {
71
+ "anyOf" : [
72
+ {
73
+ "properties" : {
74
+ "bar" : {"type" : " integer" }
75
+ },
76
+ "required" : [" bar" ]
77
+ },
78
+ {
79
+ "properties" : {
80
+ "foo" : {"type" : " string" }
81
+ },
82
+ "required" : [" foo" ]
83
+ }
84
+ ]
85
+ },
86
+ "tests" : [
87
+ {
88
+ "description" : " first anyOf valid (complex)" ,
89
+ "data" : {"bar" : 2 },
90
+ "valid" : true
91
+ },
92
+ {
93
+ "description" : " second anyOf valid (complex)" ,
94
+ "data" : {"foo" : " baz" },
95
+ "valid" : true
96
+ },
97
+ {
98
+ "description" : " both anyOf valid (complex)" ,
99
+ "data" : {"foo" : " baz" , "bar" : 2 },
100
+ "valid" : true
101
+ },
102
+ {
103
+ "description" : " neither anyOf valid (complex)" ,
104
+ "data" : {"foo" : 2 , "bar" : " quux" },
105
+ "valid" : false
106
+ }
107
+ ]
67
108
}
68
109
]
Original file line number Diff line number Diff line change 64
64
"valid" : false
65
65
}
66
66
]
67
+ },
68
+ {
69
+ "description" : " oneOf complex types" ,
70
+ "schema" : {
71
+ "oneOf" : [
72
+ {
73
+ "properties" : {
74
+ "bar" : {"type" : " integer" }
75
+ },
76
+ "required" : [" bar" ]
77
+ },
78
+ {
79
+ "properties" : {
80
+ "foo" : {"type" : " string" }
81
+ },
82
+ "required" : [" foo" ]
83
+ }
84
+ ]
85
+ },
86
+ "tests" : [
87
+ {
88
+ "description" : " first oneOf valid (complex)" ,
89
+ "data" : {"bar" : 2 },
90
+ "valid" : true
91
+ },
92
+ {
93
+ "description" : " second oneOf valid (complex)" ,
94
+ "data" : {"foo" : " baz" },
95
+ "valid" : true
96
+ },
97
+ {
98
+ "description" : " both oneOf valid (complex)" ,
99
+ "data" : {"foo" : " baz" , "bar" : 2 },
100
+ "valid" : false
101
+ },
102
+ {
103
+ "description" : " neither oneOf valid (complex)" ,
104
+ "data" : {"foo" : 2 , "bar" : " quux" },
105
+ "valid" : false
106
+ }
107
+ ]
67
108
}
68
109
]
Original file line number Diff line number Diff line change 97
97
"valid" : false
98
98
}
99
99
]
100
+ },
101
+ {
102
+ "description" : " anyOf complex types" ,
103
+ "schema" : {
104
+ "anyOf" : [
105
+ {
106
+ "properties" : {
107
+ "bar" : {"type" : " integer" }
108
+ },
109
+ "required" : [" bar" ]
110
+ },
111
+ {
112
+ "properties" : {
113
+ "foo" : {"type" : " string" }
114
+ },
115
+ "required" : [" foo" ]
116
+ }
117
+ ]
118
+ },
119
+ "tests" : [
120
+ {
121
+ "description" : " first anyOf valid (complex)" ,
122
+ "data" : {"bar" : 2 },
123
+ "valid" : true
124
+ },
125
+ {
126
+ "description" : " second anyOf valid (complex)" ,
127
+ "data" : {"foo" : " baz" },
128
+ "valid" : true
129
+ },
130
+ {
131
+ "description" : " both anyOf valid (complex)" ,
132
+ "data" : {"foo" : " baz" , "bar" : 2 },
133
+ "valid" : true
134
+ },
135
+ {
136
+ "description" : " neither anyOf valid (complex)" ,
137
+ "data" : {"foo" : 2 , "bar" : " quux" },
138
+ "valid" : false
139
+ }
140
+ ]
100
141
}
101
142
]
Original file line number Diff line number Diff line change 108
108
"valid" : false
109
109
}
110
110
]
111
+ },
112
+ {
113
+ "description" : " oneOf complex types" ,
114
+ "schema" : {
115
+ "oneOf" : [
116
+ {
117
+ "properties" : {
118
+ "bar" : {"type" : " integer" }
119
+ },
120
+ "required" : [" bar" ]
121
+ },
122
+ {
123
+ "properties" : {
124
+ "foo" : {"type" : " string" }
125
+ },
126
+ "required" : [" foo" ]
127
+ }
128
+ ]
129
+ },
130
+ "tests" : [
131
+ {
132
+ "description" : " first oneOf valid (complex)" ,
133
+ "data" : {"bar" : 2 },
134
+ "valid" : true
135
+ },
136
+ {
137
+ "description" : " second oneOf valid (complex)" ,
138
+ "data" : {"foo" : " baz" },
139
+ "valid" : true
140
+ },
141
+ {
142
+ "description" : " both oneOf valid (complex)" ,
143
+ "data" : {"foo" : " baz" , "bar" : 2 },
144
+ "valid" : false
145
+ },
146
+ {
147
+ "description" : " neither oneOf valid (complex)" ,
148
+ "data" : {"foo" : 2 , "bar" : " quux" },
149
+ "valid" : false
150
+ }
151
+ ]
111
152
}
112
153
]
Original file line number Diff line number Diff line change 97
97
"valid" : false
98
98
}
99
99
]
100
+ },
101
+ {
102
+ "description" : " anyOf complex types" ,
103
+ "schema" : {
104
+ "anyOf" : [
105
+ {
106
+ "properties" : {
107
+ "bar" : {"type" : " integer" }
108
+ },
109
+ "required" : [" bar" ]
110
+ },
111
+ {
112
+ "properties" : {
113
+ "foo" : {"type" : " string" }
114
+ },
115
+ "required" : [" foo" ]
116
+ }
117
+ ]
118
+ },
119
+ "tests" : [
120
+ {
121
+ "description" : " first anyOf valid (complex)" ,
122
+ "data" : {"bar" : 2 },
123
+ "valid" : true
124
+ },
125
+ {
126
+ "description" : " second anyOf valid (complex)" ,
127
+ "data" : {"foo" : " baz" },
128
+ "valid" : true
129
+ },
130
+ {
131
+ "description" : " both anyOf valid (complex)" ,
132
+ "data" : {"foo" : " baz" , "bar" : 2 },
133
+ "valid" : true
134
+ },
135
+ {
136
+ "description" : " neither anyOf valid (complex)" ,
137
+ "data" : {"foo" : 2 , "bar" : " quux" },
138
+ "valid" : false
139
+ }
140
+ ]
100
141
}
101
142
]
Original file line number Diff line number Diff line change 108
108
"valid" : false
109
109
}
110
110
]
111
+ },
112
+ {
113
+ "description" : " oneOf complex types" ,
114
+ "schema" : {
115
+ "oneOf" : [
116
+ {
117
+ "properties" : {
118
+ "bar" : {"type" : " integer" }
119
+ },
120
+ "required" : [" bar" ]
121
+ },
122
+ {
123
+ "properties" : {
124
+ "foo" : {"type" : " string" }
125
+ },
126
+ "required" : [" foo" ]
127
+ }
128
+ ]
129
+ },
130
+ "tests" : [
131
+ {
132
+ "description" : " first oneOf valid (complex)" ,
133
+ "data" : {"bar" : 2 },
134
+ "valid" : true
135
+ },
136
+ {
137
+ "description" : " second oneOf valid (complex)" ,
138
+ "data" : {"foo" : " baz" },
139
+ "valid" : true
140
+ },
141
+ {
142
+ "description" : " both oneOf valid (complex)" ,
143
+ "data" : {"foo" : " baz" , "bar" : 2 },
144
+ "valid" : false
145
+ },
146
+ {
147
+ "description" : " neither oneOf valid (complex)" ,
148
+ "data" : {"foo" : 2 , "bar" : " quux" },
149
+ "valid" : false
150
+ }
151
+ ]
111
152
}
112
153
]
You can’t perform that action at this time.
0 commit comments