Branch Coverage

blib/lib/OpenAPI/Modern.pm
Criterion Covered Total %
branch 86 98 87.7


line true false branch
251 73 9 if (exists $options->{'path_template'})
255 2 71 unless $path_item
260 1 70 unless $path_item->{$method}
264 8 71 if (exists $options->{'operation_id'})
267 1 7 unless $operation_path
268 1 6 unless $operation_path =~ m[^/paths/]u
274 1 5 if exists $options->{'path_template'} and $options->{'path_template'} ne $path_template
276 1 4 if lc $request->method ne $method
283 3 72 unless ($path_template)
286 0 3 if exists $schema->{'servers'} and @{$schema->{'servers'}}
290 1 2 unless $uri_path =~ /^$path_pattern$/u
309 1 71 if exists $options->{'path_captures'} and not is_equal([sort(keys %{$$options{"path_captures"}})], [sort(@capture_names)])
315 3 1 exists $options->{'path_template'} ? :
4 67 unless $uri_path =~ /^$path_pattern$/u
324 1 66 if exists $options->{'path_captures'} and not is_equal([map(($_ . ""), @$options->{'path_captures'}{@capture_names})], \@capture_values)
336 1 13 unless exists $$path_captures{$param_obj->{'name'}}
350 24 21 unless (exists $$query_params{$param_obj->{'name'}})
352 1 23 if $param_obj->{'required'}
358 1 20 if $param_obj->{'allowReserved'} // 0
365 3 20 if grep((fc $header_name eq fc $_), ("Accept", "Content-Type", "Authorization"))
370 4 16 unless (@$headers)
372 3 1 if $header_obj->{'required'}
384 12 36 if (exists $param_obj->{'content'})
386 0 12 if keys %{$$param_obj{"content"}} > 1
391 2 10 unless ($media_type_decoder)
393 0 2 XXX ? :
1 1 if XXX ? !keys(%$schema) : $schema
418 2 25 unless length $content_type
423 4 7 if m[([^/]+)/\*$]u
424 2 2 if not defined $media_type and exists $content_obj->{'*/*'}
425 2 23 unless defined $media_type
428 0 23 if (exists $content_obj->{$media_type}{'encoding'})
434 0 0 unless exists +($content_obj->{$media_type}{'schema'}{'properties'} // {})->{$property}
439 0 0 if $content_type =~ m[^multipart/]u or $content_type eq "application/x-www-form-urlencoded"
447 18 5 if (my $charset = $message->content_charset)
462 2 20 if $media_type eq "*/*"
463 2 20 unless ($media_type_decoder)
465 0 2 XXX ? :
0 2 if not defined $schema or XXX ? !keys(%$schema) : $schema
479 1 18 unless defined $schema
493 0 15 $self->evaluator->collect_annotations ? :
15 66 !@{$state->{'errors'}} ? :
500 5 41 unless $schema_info
504 1 40 if $state->{'depth'}++ > $self->evaluator->max_traversal_depth
515 53 8 XXX ? :
3 58 if XXX ? !keys(%$schema) : $schema
518 8 50 if (XXX and exists $schema->{'type'} and not XXX and grep(($schema->{'type'} eq $_), ('number', 'integer')) and &looks_like_number($data)) { }
39 12 elsif (defined $data and not XXX) { }
538 0 58 if $self->evaluator->collect_annotations