Branch Coverage

blib/lib/OpenAPI/Modern.pm
Criterion Covered Total %
branch 145 158 91.7


line true false branch
86 0 123 if $request and $options->{'request'} and $request != $options->{'request'}
208 2 62 if (my $request = $response->$OpenAPI::Modern::_call_if_can("request"))
210 0 2 if $request and $options->{'request'} and $request != $options->{'request'}
307 182 70 if $options->{'request'}
315 182 70 $options->{'request'} ? :
318 3 249 if ($options->{'request'} and my $error = $options->{'request'}->error)
326 68 181 if (exists $options->{'method'}) { }
177 4 elsif ($options->{'request'}) { }
329 2 66 if $options->{'request'} and lc $options->{'request'}->method ne $method
336 20 227 if (exists $options->{'operation_id'})
339 2 18 unless $operation_path
340 2 16 unless $operation_path =~ m[^/paths/]u
346 2 14 if exists $options->{'path_template'} and $options->{'path_template'} ne $path_template
350 4 10 if $options->{'method'} and lc $options->{'method'} ne $method
356 2 235 unless $method
360 184 51 if (exists $options->{'path_template'})
364 4 180 unless $path_item
368 2 178 unless $path_item->{$method}
372 41 2 if (not $path_template and $options->{'request'} and my $uri_path = $options->{'request'}->url->path)
375 0 41 if exists $schema->{'servers'} and @{$schema->{'servers'}}
381 7 36 unless $uri_path =~ /^$path_pattern$/u
392 2 34 unless is_elements_unique(\@capture_names, $indexes)
396 2 32 if $options->{'path_captures'} and not is_equal($options->{'path_captures'}, \%path_captures)
401 2 30 unless exists $schema->{'paths'}{$path_template}{$method}
404 26 4 unless defined $options->{'operation_id'}
412 2 186 unless $path_template
422 4 182 if exists $options->{'path_captures'} and not is_equal([sort(keys %{$$options{"path_captures"}})], [sort(@capture_names)])
424 62 120 unless ($options->{'request'})
427 58 4 unless defined $options->{'operation_id'}
439 6 2 exists $options->{'path_template'} ? :
8 112 unless $uri_path =~ /^$path_pattern$/u
448 2 110 if exists $options->{'path_captures'} and not is_equal([map(($_ . ""), @$options->{'path_captures'}{@capture_names})], \@capture_values)
453 102 8 unless defined $options->{'operation_id'}
463 2 22 unless exists $$path_captures{$param_obj->{'name'}}
477 54 49 unless (exists $$query_params{$param_obj->{'name'}})
479 2 52 if $param_obj->{'required'}
485 1 48 if $param_obj->{'allowReserved'} // 0
492 3 53 if grep((fc $header_name eq fc $_), ("Accept", "Content-Type", "Authorization"))
498 10 43 unless (@$headers)
500 6 4 if $header_obj->{'required'}
512 32 80 if (exists $param_obj->{'content'})
514 0 32 if keys %{$$param_obj{"content"}} > 1
519 4 28 unless ($media_type_decoder)
521 2 2 XXX ? :
2 2 if XXX ? !keys(%$schema) : $schema
550 4 82 unless length $content_type
555 16 18 if m[([^/]+)/\*$]u
556 12 4 if not defined $media_type and exists $content_obj->{'*/*'}
557 4 78 unless defined $media_type
560 0 78 if (exists $content_obj->{$media_type}{'encoding'})
566 0 0 unless exists +($content_obj->{$media_type}{'schema'}{'properties'} // {})->{$property}
571 0 0 if $content_type =~ m[^multipart/]u or $content_type eq "application/x-www-form-urlencoded"
579 10 68 if ($content_type =~ m[^text/]u and my $charset = $message->content->charset)
594 12 62 if $media_type eq "*/*"
595 4 70 unless ($media_type_decoder)
597 2 2 XXX ? :
0 4 if not defined $schema or XXX ? !keys(%$schema) : $schema
611 2 64 unless defined $schema
626 11 179 $exception ? :
46 144 !@{$state->{'errors'}} ? :
633 10 82 unless $schema_info
637 2 80 if $state->{'depth'}++ > $self->evaluator->max_traversal_depth
640 2 78 if $schema_info->{'document'}->get_entity_at_location($schema_info->{'document_path'}) ne $entity_type
652 18 148 unless (XXX)
653 2 16 if $schema
656 6 0 $location[-2] eq 'header' ? :
2 6 $location[-2] eq 'path' ? :
2 8 $location[-2] eq 'query' ? :
6 10 $location[-1] eq 'body' ? :
665 6 142 unless keys %$schema
674 66 76 $state->{'stringy_numbers'} ? :
686 89 93 if $request->isa("Mojo::Message::Request")
687 93 0 if ($request->isa("HTTP::Request"))
689 89 4 unless (defined $request->headers->content_length)
691 30 59 if $length
701 26 27 if $response->isa("Mojo::Message::Response")
702 27 0 if ($response->isa("HTTP::Response"))
704 22 5 unless (defined $response->headers->content_length)
706 10 12 if $length