Skip to content

Commit 18b91ac

Browse files
committed
Fix #102: Fix array item choices validation
1 parent 38cd956 commit 18b91ac

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

src/dataValidation.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ export default function DataValidator(schema) {
101101

102102
let minItems = getKeyword(schema, 'minItems', 'min_items');
103103
let maxItems = getKeyword(schema, 'maxItems', 'max_items');
104-
let choices = getKeyword(schema.items, 'choices', 'enum');
105104

106105
if (minItems && data.length < parseInt(minItems))
107106
this.addError(coords, 'Minimum ' + minItems + ' items required.');
@@ -120,12 +119,6 @@ export default function DataValidator(schema) {
120119
}
121120
}
122121

123-
if (choices) {
124-
let invalid_choice = data.find((i) => choices.indexOf(i) === -1);
125-
if (typeof invalid_choice !== 'undefined')
126-
this.addError(coords, 'Invalid choice + "' + invalid_choice + '"');
127-
}
128-
129122
let next_validator = this.getValidator(next_type);
130123

131124
// currently allOf is not supported in array items

0 commit comments

Comments
 (0)