Commit 59c5869 1 parent b84f086 commit 59c5869 Copy full SHA for 59c5869
File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -324,9 +324,6 @@ class Validator {
324
324
) {
325
325
return 'Value does not match pattern' ;
326
326
}
327
-
328
- // Here slotType value tested and is ok!
329
- continue ;
330
327
}
331
328
332
329
// Here value didn't parse to slotType
@@ -343,6 +340,11 @@ class Validator {
343
340
const results = anyOfValidators . map ( ( fn ) => fn ( value ) ) ;
344
341
const valid = results . some ( ( result ) => result === undefined ) ;
345
342
if ( ! valid ) {
343
+ // If every condition gives format error, just return one error
344
+ // TODO does this apply in allOf, second branch of exactlyOneOf?
345
+ if ( results . every ( ( result ) => result === parse_error ) ) {
346
+ return parse_error ;
347
+ }
346
348
return results . join ( '\n' ) ;
347
349
}
348
350
}
You can’t perform that action at this time.
0 commit comments