Branch Coverage

blib/lib/JSON/Schema/Draft201909/Vocabulary/Applicator.pm
Criterion Covered Total %
branch 181 186 97.3


line true false branch
50 460 117 if ($self->eval($data, $schema->{'allOf'}[$idx], {%$state, 'schema_path', $state->{'schema_path'} . '/allOf/' . $idx, 'annotations', \@annotations})) { }
56 40 77 if $state->{'short_circuit'}
60 125 104 if (@invalid == 0)
66 10 94 $pl ? :
10 94 $pl ? :
78 386 225 unless $self->eval($data, $schema->{'anyOf'}[$idx], {%$state, 'errors', \@errors, 'schema_path', $state->{'schema_path'} . '/anyOf/' . $idx})
80 92 133 if $state->{'short_circuit'}
83 212 124 if $valid
100 72 86 unless $self->eval($data, $schema->{'oneOf'}[$idx], {%$state, 'errors', \@errors, 'annotations', \@annotations, 'schema_path', $state->{'schema_path'} . '/oneOf/' . $idx})
103 9 12 if @valid > 1 and $state->{'short_circuit'}
106 45 41 if (@valid == 1)
110 21 20 if (not @valid) { }
127 18 41 unless $self->eval($data, $schema->{'not'}, {%$state, 'schema_path', $state->{'schema_path'} . '/not', 'short_circuit', $state->{'short_circuit'} || !$state->{'collect_annotations'}, 'errors', [], 'annotations', [@{$state->{'annotations'};}]})
140 8 0 unless exists $schema->{'then'} or exists $schema->{'else'} or $state->{'collect_annotations'}
144 35 37 $self->eval($data, $schema->{'if'}, {%$state, 'schema_path', $state->{'schema_path'} . '/if', 'short_circuit', $state->{'short_circuit'} || !$state->{'collect_annotations'}, 'errors', []}) ? :
148 6 66 unless exists $schema->{$keyword}
150 40 26 if $self->eval($data, $schema->{$keyword}, {%$state, 'schema_path', $state->{'schema_path'} . '/' . $keyword})
159 56 86 unless is_type('object', $data)
165 46 53 unless exists $data->{$property}
168 9 44 if ($self->eval($data, $schema->{'dependentSchemas'}{$property}, {%$state, 'annotations', \@annotations, 'schema_path', jsonp($state->{'schema_path'}, 'dependentSchemas', $property)}))
176 22 22 if $state->{'short_circuit'}
179 44 42 unless $valid
187 395 105 if XXX
194 406 152 if XXX
205 10 92 unless exists $state->{'_last_items_index'}
213 75 331 unless is_type('array', $data)
220 111 479 if $idx > $#{$$schema{$state->{'keyword'}};}
224 123 356 if (is_type('boolean', $$schema{$state->{'keyword'}}[$idx])) { }
332 24 elsif ($self->eval($data->[$idx], $$schema{$state->{'keyword'}}[$idx], {%$state, 'annotations', \@annotations, 'data_path', $state->{'data_path'} . '/' . $idx, 'schema_path', $state->{'schema_path'} . '/' . $state->{'keyword'} . '/' . $idx})) { }
225 84 39 if $$schema{$state->{'keyword'}}[$idx]
238 26 37 if $state->{'short_circuit'} and not exists $schema->{'additionalItems'}
241 62 269 unless $valid
250 29 215 unless is_type('array', $data)
251 67 148 if $state->{'_last_items_index'} == $#{$data;}
258 28 203 if (is_type('boolean', $$schema{$state->{'keyword'}})) { }
259 12 16 if $$schema{$state->{'keyword'}}
261 11 5 $state->{'keyword'} eq 'additionalItems' ? :
265 136 62 if ($self->eval($data->[$idx], $$schema{$state->{'keyword'}}, {%$state, 'annotations', \@annotations, 'data_path', $state->{'data_path'} . '/' . $idx, 'schema_path', $state->{'schema_path'} . '/' . $state->{'keyword'}}))
275 29 49 if $state->{'short_circuit'}
281 19 48 $state->{'keyword'} eq 'additionalItems' ? :
67 76 unless $valid
299 3 222 unless $state->{'collect_annotations'}
302 104 118 if $state->{'short_circuit'}
304 36 82 unless is_type('array', $data)
313 5 49 if is_type('boolean', $_->annotation)
314 5 77 if &any(sub {
318 38 39 if $last_index == $#{$data;}
324 38 5 if (is_type('boolean', $schema->{'unevaluatedItems'})) { }
325 5 33 if $schema->{'unevaluatedItems'}
331 3 2 if ($self->eval($data->[$idx], $schema->{'unevaluatedItems'}, {%$state, 'annotations', \@annotations, 'data_path', $state->{'data_path'} . '/' . $idx, 'schema_path', $state->{'schema_path'} . '/unevaluatedItems'}))
341 0 35 if $state->{'short_circuit'}
344 34 5 unless $valid
354 75 161 unless is_type('array', $data)
361 129 58 if ($self->eval($data->[$idx], $schema->{'contains'}, {%$state, 'errors', \@errors, 'annotations', \@annotations, 'data_path', $state->{'data_path'} . '/' . $idx, 'schema_path', $state->{'schema_path'} . '/contains'}))
370 36 24 if $state->{'short_circuit'} and !exists $schema->{'maxContains'} || $state->{'_num_contains'} > $schema->{'maxContains'} and $state->{'_num_contains'} >= ($schema->{'minContains'} // 1)
375 65 96 if (not $state->{'_num_contains'} and ($schema->{'minContains'} // 1) > 0)
389 81 1035 unless is_type('object', $data)
395 3410 706 unless exists $data->{$property}
397 83 623 if (is_type('boolean', $schema->{'properties'}{$property})) { }
398 41 42 if ($schema->{'properties'}{$property})
408 441 176 if ($self->eval($data->{$property}, $schema->{'properties'}{$property}, {%$state, 'annotations', \@annotations, 'data_path', jsonp($state->{'data_path'}, $property), 'schema_path', jsonp($state->{'schema_path'}, 'properties', $property)}))
419 90 128 if $state->{'short_circuit'}
422 206 823 unless $valid
430 0 221 unless assert_keyword_type($state, $schema, 'object')
433 2 380 unless assert_pattern({%$state, '_schema_path_suffix', $property}, $property)
441 66 149 unless is_type('object', $data)
448 78 87 if (is_type('boolean', $schema->{'patternProperties'}{$property_pattern})) { }
449 38 40 if ($schema->{'patternProperties'}{$property_pattern})
459 51 36 if ($self->eval($data->{$property}, $schema->{'patternProperties'}{$property_pattern}, {%$state, 'annotations', \@annotations, 'data_path', jsonp($state->{'data_path'}, $property), 'schema_path', jsonp($state->{'schema_path'}, 'patternProperties', $property_pattern)}))
470 31 45 if $state->{'short_circuit'}
474 64 85 unless $valid
484 122 270 unless is_type('object', $data)
490 56 33 if exists $schema->{'properties'} and exists $schema->{'properties'}{$property}
492 8 209 if exists $schema->{'patternProperties'} and &any(sub {
494 55 154 if (is_type('boolean', $schema->{'additionalProperties'})) { }
495 8 47 if ($schema->{'additionalProperties'})
505 79 75 if ($self->eval($data->{$property}, $schema->{'additionalProperties'}, {%$state, 'annotations', \@annotations, 'data_path', jsonp($state->{'data_path'}, $property), 'schema_path', $state->{'schema_path'} . '/additionalProperties'}))
516 53 69 if $state->{'short_circuit'}
519 121 149 unless $valid
537 2 252 unless $state->{'collect_annotations'}
540 112 140 if $state->{'short_circuit'}
542 28 112 unless is_type('object', $data)
547 89 0 grep(($keyword eq $_), ('properties', 'additionalProperties', 'patternProperties', 'unevaluatedProperties')) ? :
554 79 69 if &any(sub {
556 64 5 if (is_type('boolean', $schema->{'unevaluatedProperties'})) { }
557 15 49 if ($schema->{'unevaluatedProperties'})
567 3 2 if ($self->eval($data->{$property}, $schema->{'unevaluatedProperties'}, {%$state, 'annotations', \@annotations, 'data_path', jsonp($state->{'data_path'}, $property), 'schema_path', $state->{'schema_path'} . '/unevaluatedProperties'}))
578 0 51 if $state->{'short_circuit'}
581 44 68 unless $valid
591 60 79 unless is_type('object', $data)
598 17 37 if ($self->eval($property, $schema->{'propertyNames'}, {%$state, 'annotations', \@annotations, 'data_path', jsonp($state->{'data_path'}, $property), 'schema_path', $state->{'schema_path'} . '/propertyNames'}))
607 20 17 if $state->{'short_circuit'}
610 37 42 unless $valid