Skip to content

Commit dbdfe90

Browse files
committed
fixes #190 keep the old test cases for oneOf
1 parent 7875ef7 commit dbdfe90

File tree

1 file changed

+60
-3
lines changed

1 file changed

+60
-3
lines changed

src/test/resources/tests/oneOf.json

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,63 @@
6565
}
6666
]
6767
},
68+
{
69+
"description": "oneOf with objects and type pattern",
70+
"schema": {
71+
"oneOf": [
72+
{
73+
"type": "object",
74+
"required": [
75+
"type"
76+
],
77+
"properties": {
78+
"type": {
79+
"enum": [
80+
"TYPE_1"
81+
]
82+
}
83+
}
84+
},
85+
{
86+
"type": "object",
87+
"required": [
88+
"type"
89+
],
90+
"properties": {
91+
"type": {
92+
"enum": [
93+
"TYPE_2"
94+
]
95+
}
96+
}
97+
}
98+
99+
]
100+
},
101+
"tests": [
102+
{
103+
"description": "first oneOf valid",
104+
"data": {
105+
"type": "TYPE_1"
106+
},
107+
"valid": true
108+
},
109+
{
110+
"description": "second oneOf valid",
111+
"data": {
112+
"type": "TYPE_2"
113+
},
114+
"valid": true
115+
},
116+
{
117+
"description": "neither oneOf valid",
118+
"data": {
119+
"type": "INVALID_TYPE"
120+
},
121+
"valid": false
122+
}
123+
]
124+
},
68125
{
69126
"description": "oneOf with objects and type pattern",
70127
"schema": {
@@ -79,7 +136,7 @@
79136
"type": "string"
80137
}
81138
}
82-
},
139+
},
83140
{
84141
"type": "object",
85142
"required": [
@@ -93,7 +150,7 @@
93150
}
94151
}
95152
}
96-
153+
97154
]
98155
},
99156
"tests": [
@@ -127,7 +184,7 @@
127184
"oneOf": [
128185
{
129186
"type": "object",
130-
187+
131188
"required": [
132189
"type"
133190
],

0 commit comments

Comments
 (0)