File tree 1 file changed +6
-10
lines changed
lib/JSON/Schema/Draft201909/Vocabulary
1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -373,19 +373,15 @@ sub _eval_keyword_contains {
373
373
return 0 if $state -> {short_circuit };
374
374
}
375
375
376
- if (exists $schema -> {maxContains }) {
377
- local $state -> {keyword } = ' maxContains' ;
378
-
379
- if ($num_valid > $schema -> {maxContains }) {
380
- $valid = 0;
381
- E($state , ' contains too many matching items' );
382
- return 0 if $state -> {short_circuit };
383
- }
376
+ # TODO: in the future, we can move these implementations to the Validation vocabulary
377
+ # and inspect the annotation produced by the 'contains' keyword.
378
+ if (exists $schema -> {maxContains } and $num_valid > $schema -> {maxContains }) {
379
+ $valid = E({ %$state , keyword => ' maxContains' }, ' contains too many matching items' );
380
+ return 0 if $state -> {short_circuit };
384
381
}
385
382
386
383
if ($num_valid < ($schema -> {minContains } // 1)) {
387
- $valid = 0;
388
- E({ %$state , keyword => ' minContains' }, ' contains too few matching items' );
384
+ $valid = E({ %$state , keyword => ' minContains' }, ' contains too few matching items' );
389
385
return 0 if $state -> {short_circuit };
390
386
}
391
387
You can’t perform that action at this time.
0 commit comments