Branch Coverage

lib/JSON/Schema/Validate.pm
Criterion Covered Total %
branch 682 1262 54.0


line true false branch
37 0 121 if (defined $schema and !ref($schema) || ref $schema ne 'HASH')
94 718 8 unless exists $opts->{$opt}
95 8 0 $opts->{$opt} ? :
98 121 0 unless exists $opts->{'unique_keys'}
99 1 120 if (exists $opts->{'ignore_unknown_required_vocab'})
101 1 0 $opts->{'ignore_unknown_required_vocab'} ? :
103 11 110 if (exists $opts->{'compile'})
105 10 1 $opts->{'compile'} ? :
107 6 115 if (exists $opts->{'trace'})
109 6 0 $opts->{'trace'} ? :
115 235 7 unless exists $opts->{$opt}
119 1 120 if (exists $opts->{'trace_sample'})
122 1 0 if ($opts->{'trace_sample'} =~ /^([0-9]{1,2}|100)$/u) { }
128 0 0 if warnings::enabled()
133 3 118 if ($opts->{'format'} and ref $opts->{'format'} eq "HASH")
137 1 120 $opts->{'vocab_support'} ? :
139 120 1 unless $self->{'ignore_req_vocab'}
140 1 119 if $self->{'content_assert'}
141 10 110 if $self->{'compile_on'}
151 0 1 defined $bool ? :
154 1 0 if ($self->{'compile_on'} and not $self->{'compiled'})
167 0 0 unless my $schema = $self->{'schema'}
172 0 0 exists $opts->{'name'} && defined $opts->{'name'} && length $opts->{'name'} ? :
175 0 0 exists $opts->{'max_errors'} ? :
176 0 0 if $max_errors < 0
271 3 0 defined $bool ? :
272 3 0 $on ? :
273 3 0 if $self->{'content_assert'}
291 1 0 defined $bool ? :
300 0 3 unless $self->{'last_trace'}
312 0 0 defined $bool ? :
317 0 0 $_[0]{'compile_on'} ? :
319 0 0 $_[0]{'content_assert'} ? :
322 0 0 $_[0]{'trace_on'} ? :
324 0 0 $_[0]{'unique_keys'} ? :
326 0 0 $_[0]{'ignore_req_vocab'} ? :
339 1 1 $self->validate($data, $opts) ? :
350 5 0 if ($self->{'normalize_instance'})
361 0 0 defined $bool ? :
362 0 0 $on ? :
371 0 47 eval {
372 47 0 eval {
373 47 0 eval {
374 0 47 eval {
384 0 2 unless defined $s and not ref $s
387 0 2 if ($has_iso)
389 0 0 'DateTime::Format::ISO8601'->parse_datetime($s) ? :
0 0 eval {
393 0 2 unless $s =~ /\A
404 2 0 if ($has_tp)
409 1 1 eval {
413 0 0 if ($has_dt)
416 0 0 eval {
436 0 2 unless defined $s and not ref $s
437 0 2 unless $s =~ /\A(\d{4})-(\d{2})-(\d{2})\z/u
441 2 0 if ($has_tp)
443 1 1 eval {
447 0 0 if ($has_dt)
449 0 0 eval {
459 0 2 unless defined $s and not ref $s
460 0 2 if ($has_iso)
462 0 0 'DateTime::Format::ISO8601'->parse_datetime("1970-01-01T$s") ? :
0 0 eval {
464 1 1 $s =~ /\A
481 0 2 unless defined $s and not ref $s
484 0 2 if $s =~ /\AP\d+W\z/u
488 1 1 $s =~ /\A
508 0 13 unless defined $s and not ref $s
509 12 1 $s =~ /$email_re/u ? :
516 0 1 unless defined $s and not ref $s
517 0 1 unless $s =~ /\A(.+)\@(.+)\z/su
520 0 1 if ($has_idn)
524 0 0 unless defined $ascii and length $ascii
527 0 0 $candidate =~ /$email_re/u ? :
531 1 0 if ($domain =~ /\A[[:ascii:]]+\z/u)
534 1 0 $candidate =~ /$email_re/u ? :
545 0 2 unless defined $s and not ref $s
546 0 2 if length $s > 253
549 0 3 unless length $label >= 1 and length $label <= 63
550 1 2 unless $label =~ /\A[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?\z/u
558 0 1 unless defined $s and not ref $s
559 0 1 if ($has_idn)
563 0 0 unless defined $ascii and length $ascii
564 0 0 $F{'hostname'}->($ascii) ? :
568 0 1 if length $s > 253
571 0 2 unless length $label >= 1 and length $label <= 63
572 0 2 unless $label =~ /\A[[:alnum:]\pL\pN](?:[[:alnum:]\pL\pN\-]*[[:alnum:]\pL\pN])?\z/u
581 0 2 unless defined $s and not ref $s
582 1 1 $s =~ /\A
593 0 2 unless defined $s and not ref $s
594 1 1 $s =~ /\A
618 0 2 unless defined $s and not ref $s
619 1 1 $s =~ /\A[A-Za-z][A-Za-z0-9+\-.]*:[^\s]+\z/u ? :
625 0 1 unless defined $s and not ref $s
626 1 0 $s =~ /\A(?:[A-Za-z][A-Za-z0-9+\-.]*:)?[^\s]+\z/u ? :
632 0 1 unless defined $s and not ref $s
636 1 0 $s =~ /\A[A-Za-z][A-Za-z0-9+\-.]*:[^\s]+\z/u ? :
643 0 3 unless defined $s and not ref $s
644 1 2 $s =~ /\A[a-fA-F0-9]{8}\-[a-fA-F0-9]{4}\-[a-fA-F0-9]{4}\-[a-fA-F0-9]{4}\-[a-fA-F0-9]{12}\z/u ? :
651 0 3 unless defined $s and not ref $s
652 1 2 if $s eq ""
653 1 1 $s =~ m[\A/(?:[^~/]|~[01])*(?:/(?:[^~/]|~[01])*)*\z]u ? :
659 0 3 unless defined $s and not ref $s
660 1 2 if $s =~ /\A0\z/u
661 1 1 $s =~ m[\A[1-9]\d*(?:#|(?:/(?:[^~/]|~[01])*)*)\z]u ? :
668 0 2 unless defined $s and not ref $s
670 1 1 eval {
675 799 0 unless exists $self->{'formats'}{$k}
684 1 0 if (ref $cb eq 'CODE') { }
698 0 0 unless defined $name and length $name
699 0 0 unless ref $code eq "CODE"
707 5 0 if (ref $cb eq 'CODE') { }
721 4 0 if (@_ > 1)
723 1 3 if (defined $code and ref $code ne "CODE")
725 1 0 if warnings::enabled()
736 2 0 if (@_ > 1)
738 0 2 if (defined $code and ref $code ne "CODE")
740 0 0 if warnings::enabled()
751 0 0 unless $h
765 1 0 defined $bool ? :
787 9 0 defined $bool ? :
802 103 115 unless $self->{'compiled'}
805 0 218 unless ($self->{'vocab_checked'})
808 0 0 if (ref $root eq "HASH" and ref $root->{'$vocabulary'} eq "HASH")
815 0 0 unless $decl->{$uri}
816 0 0 if $support->{$uri}
817 0 0 unless ($self->{'ignore_req_vocab'})
827 218 0 if ($self->{'normalize_instance'})
834 1 217 if ($self->{'prune_unknown'})
875 3 215 defined $opts->{'max_errors'} && $opts->{'max_errors'} =~ /^\d+$/u ? :
0 0 $opts->{'compile_on'} ? :
13 205 $self->{'compile_on'} ? :
0 218 defined $opts->{'compile_on'} ? :
0 0 $opts->{'trace_on'} ? :
6 212 $self->{'trace_on'} ? :
0 218 defined $opts->{'trace_on'} ? :
0 218 defined $opts->{'trace_limit'} && $opts->{'trace_limit'} =~ /^\d+$/u ? :
0 0 $opts->{'content_assert'} ? :
6 212 $self->{'content_assert'} ? :
0 218 defined $opts->{'content_assert'} ? :
878 6 212 if ($ctx->{'trace_on'})
894 106 112 unless ($res->{'ok'})
897 106 0 scalar @{$self->{'errors'};} ? :
907 5 0 if ($ref =~ /\#(.+)\z/u)
913 5 0 if (my $node = $frame->{$name})
933 3 19 if (my $node = $ctx->{'root'}{'id_index'}{$abs})
940 14 5 if ($ref =~ /^\#/u)
943 5 9 if (my $n = $ctx->{'root'}{'anchors'}{$ref})
947 0 9 if ($ref =~ /^\#([A-Za-z0-9._-]+)\z/u)
950 0 0 if (my $node = $ctx->{'root'}{'id_index'}{$cand})
957 9 0 if ($ref =~ m[\A\#/(?:[^~/]|~[01])]u)
960 0 9 unless my $root_schema = $ctx->{'root'}{'schema'}
963 8 1 if ($node)
979 5 0 if ($ctx->{'resolver'})
983 0 5 unless $ext and ref $ext
985 5 0 ref $ext eq 'HASH' && $ext->{'$id'} ? :
995 5 0 if (defined $frag and length $frag)
997 5 0 if ($frag =~ m[\A\#/(?:[^~/]|~[01])]u) { }
0 0 elsif ($frag =~ /\A\#([A-Za-z0-9._-]+)\z/u) { }
1000 5 0 if (my $node = $anchors->{$frag}) { }
1015 0 0 if (my $node = $ids->{$cand})
1043 0 120 if $self->{'vocab_checked'}
1046 2 118 if (ref $root eq "HASH" and ref $root->{'$vocabulary'} eq "HASH")
1053 2 1 unless $decl->{$uri}
1054 0 1 if $support->{$uri}
1075 0 0 exists $opts->{'ecma'} ? :
1082 0 0 if (exists $seen->{$sp})
1089 0 0 if (defined $S and not ref $S and $S =~ m[^#/]u)
1094 0 0 if (exists $seen->{$target_ptr})
1103 0 0 if (defined $target_schema and not ref $target_schema)
1112 0 0 if $followed{$target_schema}++
1118 0 0 unless (defined $target_schema)
1133 0 0 unless (ref $target_schema eq "HASH")
1150 0 0 if (ref $S eq "HASH" and exists $S->{'$ref'})
1156 0 0 if (defined $ref and $ref =~ /^#/u)
1161 0 0 if (exists $seen->{$target_ptr})
1174 0 0 if (defined $target_schema and not ref $target_schema)
1183 0 0 if $followed{$target_schema}++
1189 0 0 unless (defined $target_schema)
1206 0 0 unless (ref $target_schema eq "HASH")
1208 0 0 defined $target_schema ? :
1236 0 0 if ($local_fn ne $wrapper_fn)
1267 0 0 if (ref $S eq "HASH")
1270 0 0 if (exists $S->{'allOf'} and ref $S->{'allOf'} eq "ARRAY" and @{$S->{'allOf'};})
1291 0 0 if (exists $S->{'anyOf'} and ref $S->{'anyOf'} eq "ARRAY" and @{$S->{'anyOf'};})
1335 0 0 if (exists $S->{'oneOf'} and ref $S->{'oneOf'} eq "ARRAY" and @{$S->{'oneOf'};})
1376 0 0 if (exists $S->{'not'})
1380 0 0 if (ref $S->{'not'} eq "HASH")
1385 0 0 if (exists $N->{'required'} and ref $N->{'required'} eq 'ARRAY') { }
0 0 elsif (exists $N->{'anyOf'} and ref $N->{'anyOf'} eq 'ARRAY') { }
1397 0 0 unless (ref $elt eq "HASH" and exists $elt->{'required'} and ref $elt->{'required'} eq "ARRAY")
1405 0 0 if $all_req
1409 0 0 if (not $skip_not) { }
1442 0 0 if (exists $S->{'if'})
1459 0 0 if ($S->{'then'})
1470 0 0 if ($S->{'else'})
1489 0 0 if ($self->{'unique_keys'} and exists $S->{'uniqueKeys'} and ref $S->{'uniqueKeys'} eq "ARRAY")
1495 0 0 unless ref $keyset_ref eq "ARRAY" and @$keyset_ref
1526 0 0 ref $S eq 'HASH' && exists $S->{'type'} ? :
1530 0 0 if (exists $S->{'type'})
1532 0 0 ref $S->{'type'} eq 'ARRAY' ? :
1538 0 0 if ($t eq 'number') { }
1551 0 0 @types == 1 ? :
1569 0 0 if (exists $S->{'enum'} and ref $S->{'enum'} eq "ARRAY" and @{$S->{'enum'};})
1602 0 0 if (exists $S->{'const'})
1609 0 0 if (not ref $c) { }
1631 0 0 if (exists $S->{'required'} and ref $S->{'required'} eq "ARRAY" and @{$S->{'required'};})
1669 0 0 if ($has_string_constraints)
1678 0 0 if (exists $S->{'minLength'})
1689 0 0 if (exists $S->{'maxLength'})
1700 0 0 if (exists $S->{'pattern'} and defined $S->{'pattern'} and length $S->{'pattern'})
1710 0 0 if ($force_unicode) { }
1731 0 0 if ($pat =~ /\\p\{|\\P\{|\\X|\\R|\(\?[A-Za-z]/u) { }
1787 0 0 if ($has_num_constraints)
1809 0 0 if (exists $S->{'minimum'})
1820 0 0 if (exists $S->{'maximum'})
1831 0 0 if (exists $S->{'exclusiveMinimum'})
1843 0 0 if (exists $S->{'exclusiveMaximum'})
1857 0 0 if ($has_type_keyword) { }
1881 0 0 if (exists $S->{'items'} or $has_array_len)
1887 0 0 if (exists $S->{'items'} and ref $S->{'items'} eq "HASH")
1893 0 0 exists $S->{'minItems'} ? :
1894 0 0 exists $S->{'maxItems'} ? :
1897 0 0 if (defined $min_items)
1902 0 0 if (defined $max_items)
1913 0 0 if (defined $min_items)
1923 0 0 if (defined $max_items)
1933 0 0 if ($items_fn)
1954 0 0 if (exists $S->{'properties'} and ref $S->{'properties'} eq "HASH")
1987 0 0 if (exists $S->{'definitions'} and ref $S->{'definitions'} eq "HASH")
2003 0 0 if (exists $S->{'contains'})
2012 0 0 $have_min ? :
2013 0 0 $have_max ? :
2038 0 0 if ($have_min)
2048 0 0 if ($have_max)
2059 0 0 unless ($have_min or $have_max)
2092 0 38 unless ref $S eq "HASH"
2107 2 36 exists $S->{'minLength'} || exists $S->{'maxLength'} || exists $S->{'pattern'} ? :
2119 0 38 if (ref $S->{'prefixItems'} eq "ARRAY")
2127 0 38 if (ref $S->{'items'} eq "HASH")
2131 0 38 if (exists $S->{'contains'} and ref $S->{'contains'})
2135 0 38 if (exists $S->{'unevaluatedItems'} and ref $S->{'unevaluatedItems'} eq "HASH")
2141 11 27 if (ref $S->{'properties'} eq "HASH")
2149 0 38 if (ref $S->{'patternProperties'} eq "HASH")
2157 0 38 if (exists $S->{'additionalProperties'} and ref $S->{'additionalProperties'} eq "HASH")
2161 0 38 if (exists $S->{'propertyNames'} and ref $S->{'propertyNames'} eq "HASH")
2165 0 38 if (exists $S->{'dependentSchemas'} and ref $S->{'dependentSchemas'} eq "HASH")
2173 0 38 if (exists $S->{'unevaluatedProperties'} and ref $S->{'unevaluatedProperties'} eq "HASH")
2181 152 0 unless exists $S->{$kw}
2182 0 0 if ($kw eq "not")
2184 0 0 if ref $S->{'not'}
2187 0 0 if (ref $S->{$kw} eq "ARRAY")
2198 0 38 if (exists $S->{'if'} and ref $S->{'if'} eq "HASH")
2201 0 0 if exists $S->{'then'} and ref $S->{'then'}
2202 0 0 if exists $S->{'else'} and ref $S->{'else'}
2211 12 23 if $ctx->{'trace_on'}
2214 0 35 unless _k_type($ctx, $inst, $type_spec, $ptr)
35 0 if ($has_type)
2215 0 0 unless _k_const($ctx, $inst, $const_val, $ptr)
0 35 if ($has_const)
2216 0 0 unless _k_enum($ctx, $inst, $enum_vals, $ptr)
0 35 if ($has_enum)
2219 0 0 if ($ctx->{'unique_keys'} and $has_unique_keys and ref $inst eq "ARRAY")
2222 0 0 unless $r->{'ok'}
2226 6 29 if (_is_number($inst))
2230 25 2 unless exists $numk{$k}
2231 1 1 unless _k_number($ctx, $inst, $k, $numk{$k}, $ptr)
2236 17 17 if (not ref $inst and defined $inst)
2238 1 1 unless _k_string($ctx, $inst, $S, $ptr)
2 15 if ($has_strlen)
2239 1 1 unless _k_format($ctx, $inst, $format_name, $ptr)
2 14 if ($has_format)
2242 0 15 if (exists $S->{'contentEncoding'} or exists $S->{'contentMediaType'} or exists $S->{'contentSchema'})
2246 0 0 $ctx->{'content_assert'} ? :
2250 0 0 if (exists $S->{'contentEncoding'})
2253 0 0 if (not defined $dec) { }
2255 0 0 if $assert
2263 0 0 if (exists $S->{'contentMediaType'})
2266 0 0 if (my $cb = $ctx->{'media_validators'}{$mt}) { }
2269 0 0 unless ($ok)
2271 0 0 if $assert
2274 0 0 if ref $maybe_decoded
2276 0 0 if defined $maybe_decoded and not ref $maybe_decoded
2280 0 0 if ($mt =~ m[\Atext/]u and ($params->{'charset'} || '') =~ /\Autf-?8\z/iu)
2284 0 0 eval {
2289 0 0 if (not $ok and $assert)
2297 0 0 if (exists $S->{'contentSchema'})
2301 0 0 if (ref $decoded_ref) { }
2313 0 0 if (not defined $val) { }
2315 0 0 if $assert
2320 0 0 unless $r->{'ok'}
2330 0 32 if (ref $inst eq "ARRAY")
2333 0 0 unless $r->{'ok'}
2338 17 15 if (ref $inst eq "HASH")
2341 7 10 unless $r->{'ok'}
2347 0 25 if (exists $S->{'allOf'} and ref $S->{'allOf'} eq "ARRAY")
2353 0 0 unless $r->{'ok'}
2363 0 25 if (exists $S->{'anyOf'} and ref $S->{'anyOf'} eq "ARRAY")
2379 0 0 if ($r->{'ok'})
2390 0 0 unless ($ok)
2395 0 0 unless @$aref
2408 0 25 if (exists $S->{'oneOf'} and ref $S->{'oneOf'} eq "ARRAY")
2420 0 0 if $r->{'ok'}
2423 0 0 unless $hits == 1
2429 0 25 if (exists $S->{'not'} and ref $S->{'not'})
2440 0 0 if $r->{'ok'}
2446 0 25 if (exists $S->{'if'} and ref $S->{'if'})
2449 0 0 if ($cond->{'ok'}) { }
2451 0 0 if (exists $child{'then'})
2454 0 0 unless $r->{'ok'}
2459 0 0 if (exists $child{'else'})
2462 0 0 unless $r->{'ok'}
2467 8 17 if $ctx->{'trace_on'}
2477 114 0 if (ref $schema eq "HASH")
2479 2 112 if exists $schema->{'definitions'}
2482 9 105 ref $schema eq 'HASH' && $schema->{'$id'} ? :
2503 3 6 if (my $cb = $ctx->{'content_decoders'}{$enc})
2506 3 0 $ok ? :
2509 6 0 if ($enc eq "base64")
2524 0 176 if $ctx->{'error_count'} >= $ctx->{'max_errors'}
2528 176 0 $ctx->{'ptr_stack'} && @{$ctx->{'ptr_stack'};} ? :
2553 0 1 unless ref $schema eq "HASH"
2555 1 0 if (ref $schema->{'prefixItems'} eq "ARRAY")
2562 1 0 unless defined $out->{'prefix_items'}[$i]
2566 1 0 if (exists $schema->{'items'} and ref $schema->{'items'} eq "HASH")
2569 1 0 unless $out->{'items'}
2573 0 1 if (ref $schema->{'allOf'} eq "ARRAY")
2589 0 8 unless ref $schema eq "HASH"
2592 6 2 if (ref $schema->{'properties'} eq "HASH")
2598 7 0 unless exists $out->{'props'}{$k}
2603 1 7 if (ref $schema->{'patternProperties'} eq "HASH")
2612 7 1 if (exists $schema->{'additionalProperties'})
2617 7 0 if (not ref $ap or builtin::blessed($ap) and $ap->isa('JSON::PP::Boolean')) { }
0 0 elsif (ref $ap eq 'HASH') { }
2619 1 6 if ($ap) { }
2622 1 0 unless defined $out->{'allow_ap'} and not $out->{'allow_ap'}
2641 1 7 if (ref $schema->{'allOf'} eq "ARRAY")
2661 0 0 unless @$errs
2669 320 21 unless scalar @_
2671 2 19 if (scalar @_ == 1 and defined $_[0] and (ref $_[0] || '') eq 'HASH') { }
19 0 elsif (not scalar(@_) % 2) { }
2696 790 1209 if (ref $node eq 'HASH') { }
233 976 elsif (ref $node eq 'ARRAY') { }
2698 15 0 if (exists $node->{'$id'} and defined $node->{'$id'} and $node->{'$id'} ne "")
2704 1 0 if (exists $node->{'$anchor'} and defined $node->{'$anchor'} and $node->{'$anchor'} ne "")
2710 2 0 if (exists $node->{'$dynamicAnchor'} and defined $node->{'$dynamicAnchor'} and $node->{'$dynamicAnchor'} ne "")
2737 0 364 unless ref $inst
2742 5 23 ref $v eq 'HASH' ? :
2748 335 588 if ref $v
2749 6 582 unless defined $v
2763 278 304 $flags & ($SVf_IOK | $SVf_NOK) ? :
2766 0 23 $v ? :
5 23 ref $v eq 'HASH' ? :
2773 0 2917 unless defined $base and length $base
2779 0 2917 unless defined $token
2785 1015 1902 if ($ptr eq '#') { }
2801 0 0 unless defined $s
2821 0 9 if not defined $ptr or $ptr eq "" or $ptr eq "#"
2827 9 0 if @tokens and $tokens[0] eq ""
2838 17 0 if (ref $node eq 'HASH') { }
0 0 elsif (ref $node eq 'ARRAY') { }
2841 8 1 if ($tok eq "definitions" and not exists $node->{'definitions'} and exists $node->{'$defs'})
2848 1 16 unless (exists $node->{$tok})
2851 0 1 if $JSON::Schema::Validate::DEBUG
2859 0 0 unless ($tok =~ /^\d+$/u and $tok < @$node)
2861 0 0 if $JSON::Schema::Validate::DEBUG
2869 0 0 if $JSON::Schema::Validate::DEBUG
2883 0 32 if (exists $S->{'minItems'} and @$A < $S->{'minItems'})
2887 0 32 if (exists $S->{'maxItems'} and @$A > $S->{'maxItems'})
2892 0 32 if ($S->{'uniqueItems'})
2898 0 0 if ($seen{$k}++)
2907 5 27 if (ref $S->{'prefixItems'} eq 'ARRAY') { }
14 13 elsif (ref $S->{'items'} eq 'HASH') { }
2914 10 6 if ($i <= $tuple->$#*) { }
5 2 elsif (exists $S->{'items'} and ref $S->{'items'} eq 'HASH') { }
2917 0 10 unless $r->{'ok'}
2923 1 4 unless $r->{'ok'}
2936 2 25 unless $r->{'ok'}
2942 10 19 if (exists $S->{'contains'})
2955 21 8 if $tmp->{'ok'}
2958 10 0 defined $S->{'minContains'} ? :
2959 8 2 defined $S->{'maxContains'} ? :
2961 3 7 if $matches < $minc
2962 2 5 if $matches > $maxc
2965 3 21 if (exists $S->{'unevaluatedItems'})
2970 9 1 if $items_ann{$i}
2974 3 0 if (not _is_true($UE) || _is_hash($UE)) { }
0 0 elsif (ref $UE eq 'HASH') { }
2976 1 2 if @unknown
2983 0 0 unless $r->{'ok'}
2998 10 15 if ($kw eq "allOf")
3006 3 13 unless $r->{'ok'}
3017 2 13 if ($kw eq "anyOf")
3031 1 2 if ($r->{'ok'})
3044 0 2 unless @$aref
3054 11 2 if ($kw eq "oneOf")
3068 6 16 if ($r->{'ok'}) { }
3078 4 7 if (@ok_results == 1)
3088 0 12 unless @$aref
3105 2 0 if ($kw eq "not")
3116 1 1 if $r->{'ok'}
3129 6 0 if _json_equal($v, $const)
3138 4 11 if _json_equal($v, $e)
3147 3 52 unless $cb
3149 34 18 &$cb($s) ? :
3150 34 18 $ok ? :
3165 6 10 if ($cond->{'ok'}) { }
3167 0 6 if $ctx->{'trace_on'}
3169 0 6 unless exists $S->{'then'}
3176 0 10 if $ctx->{'trace_on'}
3178 10 0 unless exists $S->{'else'}
3188 13 75 if ($kw eq 'multipleOf') { }
62 13 elsif ($kw eq 'minimum') { }
6 7 elsif ($kw eq 'maximum') { }
5 2 elsif ($kw eq 'exclusiveMinimum') { }
2 0 elsif ($kw eq 'exclusiveMaximum') { }
3191 1 12 if (not defined $arg or $arg <= 0)
3193 0 1 if $ctx->{'trace_on'}
3199 0 0 $ok ? :
0 12 if $ctx->{'trace_on'}
3200 7 5 $ok ? :
3204 0 1 $v >= $arg ? :
1 61 if $ctx->{'trace_on'}
3205 49 13 $v >= $arg ? :
3209 0 0 $v <= $arg ? :
0 6 if $ctx->{'trace_on'}
3210 5 1 $v <= $arg ? :
3214 0 0 $v > $arg ? :
0 5 if $ctx->{'trace_on'}
3215 3 2 $v > $arg ? :
3219 0 0 $v < $arg ? :
0 2 if $ctx->{'trace_on'}
3220 1 1 $v < $arg ? :
3233 2 134 $ctx->{'max_errors'} && $ctx->{'error_count'} >= $ctx->{'max_errors'} ? :
3236 0 287 if (exists $S->{'minProperties'} and scalar keys %$H < $S->{'minProperties'})
3240 0 0 if &$bail_if_max()
3242 0 287 if (exists $S->{'maxProperties'} and scalar keys %$H > $S->{'maxProperties'})
3246 0 0 if &$bail_if_max()
3254 162 125 if (exists $S->{'required'} and ref $S->{'required'} eq "ARRAY")
3259 251 36 if (my $P = $S->{'properties'})
3264 0 393 unless ref $pd eq "HASH"
3266 50 343 if (exists $pd->{'required'})
3268 48 2 $pd->{'required'} ? :
3270 4 389 if (exists $pd->{'optional'})
3272 2 2 $pd->{'optional'} ? :
3279 218 39 if exists $H->{$rq}
3280 1 38 if $ctx->{'trace_on'}
3285 39 0 @need ? :
3286 37 2 @have ? :
3299 1 38 if &$bail_if_max()
3302 6 280 if (exists $S->{'propertyNames'} and ref $S->{'propertyNames'} eq "HASH")
3307 2 10 unless ($r->{'ok'})
3310 0 2 if &$bail_if_max()
3318 171 115 $addl_set ? :
3330 288 155 if (exists $props->{$k})
3333 74 214 unless ($r->{'ok'})
3337 1 73 if &$bail_if_max()
3344 155 214 unless ($matched)
3350 2 2 unless $re_ok
3353 0 2 unless ($r->{'ok'})
3357 0 0 if &$bail_if_max()
3365 153 216 unless ($matched)
3367 16 137 if ($addl_set and not _is_true($addl) and not _is_hash($addl)) { }
5 132 elsif (ref $addl eq 'HASH') { }
3372 0 16 if &$bail_if_max()
3378 0 5 unless ($r->{'ok'})
3382 0 0 if &$bail_if_max()
3392 8 277 if (my $depR = $S->{'dependentRequired'})
3396 2 6 unless exists $H->{$k}
3397 0 6 unless $depR->{$k}
3399 4 2 if exists $H->{$need}
3402 0 2 if &$bail_if_max()
3407 8 277 if (my $depS = $S->{'dependentSchemas'})
3411 3 5 unless exists $H->{$k}
3413 2 3 unless ($r->{'ok'})
3416 0 2 if &$bail_if_max()
3421 4 281 if (exists $S->{'unevaluatedProperties'})
3426 4 0 if (not _is_true($UE) || _is_hash($UE)) { }
0 0 elsif (ref $UE eq 'HASH') { }
3428 1 3 if (@unknown)
3432 0 1 if &$bail_if_max()
3440 0 0 unless ($r->{'ok'})
3443 0 0 if &$bail_if_max()
3451 167 118 $ok ? :
3459 7 43 if (exists $S->{'minLength'} and $len < $S->{'minLength'})
3461 1 6 if $ctx->{'trace_on'}
3464 0 25 if exists $S->{'minLength'} and $ctx->{'trace_on'}
3466 1 42 if (exists $S->{'maxLength'} and $len > $S->{'maxLength'})
3468 0 1 if $ctx->{'trace_on'}
3471 0 4 if exists $S->{'maxLength'} and $ctx->{'trace_on'}
3473 18 24 if (exists $S->{'pattern'})
3478 0 0 $ok ? :
0 18 if $ctx->{'trace_on'}
3479 2 16 unless $ok
3489 26 556 ref $type_kw eq 'ARRAY' ? :
3495 20 622 if (ref $alt eq "HASH")
3498 3 17 if $r->{'ok'}
3506 15 595 if ref $t
3507 543 52 if _match_type($v, $t)
3510 15 34 if (ref $_) { }
3517 0 17 unless (ref $uk_def eq "ARRAY" and @$uk_def)
3524 0 19 unless ref $key_set eq "ARRAY" and @$key_set
3530 2 40 unless ref $item eq "HASH"
3536 44 3 if (exists $item->{$key}) { }
3548 3 37 unless $all_present
3551 8 29 if (exists $seen{$composite})
3577 1 594 if $t eq "null" and not defined $v
3579 16 578 if ($t eq "boolean")
3581 2 14 unless defined $v
3582 8 6 if (builtin::blessed($v) and ref($v) =~ /Boolean/u)
3585 8 0 $s eq '0' || $s eq '1' ? :
3587 2 4 $v =~ /\A(?:0|1|true|false)\z/iu ? :
3590 113 465 if ($t eq "integer")
3592 14 99 unless _is_number($v)
3593 98 1 $v =~ /\A-?(?:0|[1-9][0-9]*)\z/u ? :
3596 33 432 if ($t eq "number")
3601 140 292 if ($t eq "string")
3604 132 8 !ref($v) && defined $v && !_is_number($v) ? :
3607 37 255 if $t eq "array" and ref $v eq "ARRAY"
3608 236 19 if $t eq "object" and ref $v eq "HASH"
3616 0 119 unless defined $u and length $u
3630 0 7 unless defined $k
3632 0 7 unless defined $v
3660 1 2 if (defined $shape->{'prefix_items'}[$i]) { }
2 0 elsif ($shape->{'items'}) { }
3669 2 1 if ($item_schema and ref $item) { }
3706 7 9 if (exists $shape->{'props'}{$key})
3721 2 1 $key =~ /$re/u ? :
3724 1 2 unless $ok
3731 0 7 if ($shape->{'allow_ap'}) { }
3733 0 0 if ($shape->{'ap_schema'} and ref $val) { }
3758 0 17 unless ref $schema eq "HASH"
3761 6 11 if (ref $data eq 'HASH') { }
1 10 elsif (ref $data eq 'ARRAY') { }
3779 8 66 if $n eq $target
3800 0 0 unless defined $re and length $re
3811 0 0 if (length $hex <= 4) { }
3836 0 0 if (exists $SCRIPT_LIKE{$norm}) { }
3851 0 0 if ($style eq "string")
3875 0 2 if $@
3886 19 18 if not defined $base or $base eq "" or $ref =~ /^[A-Za-z][A-Za-z0-9+\-.]*:/u
3887 17 1 if ($ref =~ /^\#/u)
3892 0 1 if $base =~ m[/$]u
3903 0 8 if $@
3906 8 0 if (@ret >= 2)
3908 6 2 $ret[0] ? :
3913 0 0 if (@ret == 1)
3917 0 0 if ref $v
3919 0 0 $v ? :
0 0 defined $v ? :
3929 50 0 unless &Encode::is_utf8($s)
3938 0 6 unless defined $s
3944 3 3 unless $norm =~ m[\A[A-Za-z0-9+/]*={0,2}\z]u
3947 0 3 unless length($norm) % 4 == 0
3950 0 3 unless eval {
3959 0 3 unless $re eq $norm
3966 0 44 unless $ctx->{'trace_on'}
3968 0 44 if ($ctx->{'trace_limit'} and @{$ctx->{'trace'};} >= $ctx->{'trace_limit'})
3972 8 36 if ($ctx->{'trace_sample'})
3974 8 0 if int rand 100 >= $ctx->{'trace_sample'}
3994 364 351 if (ref $inst)
3998 0 364 if $ctx->{'visited'}{$vkey}++
4003 11 0 if (ref $schema eq "HASH" and exists $schema->{'$dynamicAnchor'} and defined $schema->{'$dynamicAnchor'} and $schema->{'$dynamicAnchor'} ne "")
4016 11 704 if ($frame_added)
4029 22 693 if (ref $schema eq "HASH" and exists $schema->{'$ref'})
4034 5 688 if (ref $schema eq "HASH" and exists $schema->{'$dynamicRef'})
4039 9 679 if (ref $schema eq "HASH" and exists $schema->{'$comment'} and defined $schema->{'$comment'})
4044 4 5 if (my $cb = $ctx->{'comment_handler'})
4050 9 0 if $ctx->{'trace_on'}
4053 12 676 if $ctx->{'trace_on'}
4056 35 653 if ($ctx->{'compile_on'})
4059 23 12 unless ($fn)
4067 0 653 unless ref $schema eq "HASH"
4072 547 106 if (exists $schema->{'type'})
4074 36 511 unless _k_type($ctx, $inst, $schema->{'type'}, $ptr)
4076 6 611 if (exists $schema->{'const'})
4078 0 6 unless _k_const($ctx, $inst, $schema->{'const'}, $ptr)
4080 8 609 if (exists $schema->{'enum'})
4082 4 4 unless _k_enum($ctx, $inst, $schema->{'enum'}, $ptr)
4084 0 613 if $ctx->{'trace_on'}
4086 17 0 if ($ctx->{'unique_keys'} and exists $schema->{'uniqueKeys'} and ref $schema->{'uniqueKeys'} eq "ARRAY" and ref $inst eq "ARRAY")
4092 8 9 unless $r->{'ok'}
4096 139 466 if (_is_number($inst))
4100 545 86 unless exists $schema->{$k}
4101 22 64 unless _k_number($ctx, $inst, $k, $schema->{$k}, $ptr)
4106 265 318 if (not ref $inst and defined $inst)
4108 18 217 if (exists $schema->{'minLength'} or exists $schema->{'maxLength'} or exists $schema->{'pattern'})
4110 9 39 unless _k_string($ctx, $inst, $schema, $ptr)
4112 53 203 if (exists $schema->{'format'})
4114 17 36 unless _k_format($ctx, $inst, $schema->{'format'}, $ptr)
4118 0 230 if (exists $schema->{'contentEncoding'} or exists $schema->{'contentMediaType'} or exists $schema->{'contentSchema'})
4122 6 3 $ctx->{'content_assert'} ? :
4126 9 0 if (exists $schema->{'contentEncoding'})
4129 3 6 if (not defined $dec) { }
4131 2 1 if $assert
4139 7 0 if (exists $schema->{'contentMediaType'})
4142 5 2 if (my $cb = $ctx->{'media_validators'}{$mt}) { }
4145 2 3 unless ($ok)
4147 1 1 if $assert
4149 2 2 if ref $maybe_decoded
4150 1 3 if defined $maybe_decoded and not ref $maybe_decoded
4154 0 2 if ($mt =~ m[\Atext/]u and ($params->{'charset'} || '') =~ /\Autf-?8\z/iu)
4158 0 0 eval {
4163 0 0 if (not $ok and $assert)
4171 4 2 if (exists $schema->{'contentSchema'})
4174 2 2 if (ref $decoded_ref) { }
4184 1 3 if (not defined $val) { }
4186 0 1 if $assert
4191 1 2 unless $r->{'ok'}
4201 32 521 if (ref $inst eq "ARRAY")
4204 9 23 unless $r->{'ok'}
4207 0 23 if ref $inst eq "ARRAY" and $ctx->{'trace_on'}
4210 270 274 if (ref $inst eq "HASH")
4213 113 157 unless $r->{'ok'}
4216 0 157 if ref $inst eq "HASH" and $ctx->{'trace_on'}
4221 1681 25 unless exists $schema->{$comb}
4223 12 13 unless $r->{'ok'}
4226 0 13 if $ctx->{'trace_on'}
4230 16 403 if (exists $schema->{'if'})
4233 3 13 unless $r->{'ok'}
4238 0 416 if $ctx->{'trace_on'}
4271 4 176 if (@_ == 2 and not $_[0] =~ /^(?:path|message|keyword|schema_pointer)$/u) { }
4280 704 0 if exists $args->{$_}
4302 8 1 $sp ? :
4308 0 8 if @_
4315 0 29 if @_
4322 0 17 if @_
4329 0 10 if @_
4339 4 2 if (defined $other and builtin::blessed($other) and $other->isa('JSON::Schema::Validate::Error')) { }
2 0 elsif (not ref $other) { }
4343 2 2 if (($self->message // '') eq ($other->message // '') and ($self->path // '') eq ($other->path // '')) { }