Skip to content

Commit 6c40eed

Browse files
committed
Invalidate schema when array items has allOf
1 parent 8c40b8f commit 6c40eed

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/schemaValidation.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ export function validateArray(schema) {
188188
!schema.items.hasOwnProperty('anyOf') &&
189189
!schema.items.hasOwnProperty('allOf')
190190
)
191-
return {isValid: false, msg: "Array 'items' must have a 'type' or '$ref' or 'oneOf' or 'anyOf' or 'allOf'"};
191+
return {isValid: false, msg: "Array 'items' must have a 'type' or '$ref' or 'oneOf' or 'anyOf'"};
192192
}
193193

194194
if (schema.items.hasOwnProperty('oneOf')) {
@@ -204,9 +204,11 @@ export function validateArray(schema) {
204204
}
205205

206206
if (schema.items.hasOwnProperty('allOf')) {
207-
validation = validateAllOf(schema.items);
208-
if (!validation.isValid)
209-
return validation;
207+
// we don't support allOf inside array yet
208+
return {
209+
isValid: false,
210+
msg: "Currently, 'allOf' inside array items is not supported"
211+
}
210212
}
211213

212214
return {isValid: true, msg: ""};

0 commit comments

Comments
 (0)