Branch Coverage

blib/lib/OpenAPI/Modern.pm
Criterion Covered Total %
branch 146 158 92.4


line true false branch
196 2 62 if (my $request = $response->$OpenAPI::Modern::_call_if_can("request"))
198 0 2 if $request and $options->{'request'} and $request != $options->{'request'}
291 180 70 if $options->{'request'}
299 180 70 $options->{'request'} ? :
302 3 247 if ($options->{'request'} and my $error = $options->{'request'}->error)
310 68 179 if (exists $options->{'method'}) { }
175 4 elsif ($options->{'request'}) { }
313 2 66 if $options->{'request'} and lc $options->{'request'}->method ne $method
320 20 225 if (exists $options->{'operation_id'})
323 2 18 unless $operation_path
324 2 16 unless $operation_path =~ m[^/paths/]u
330 2 14 if exists $options->{'path_template'} and $options->{'path_template'} ne $path_template
334 4 10 if $options->{'method'} and lc $options->{'method'} ne $method
340 2 233 unless $method
344 182 51 if (exists $options->{'path_template'})
348 4 178 unless $path_item
352 2 176 unless $path_item->{$method}
356 41 2 if (not $path_template and $options->{'request'} and my $uri_path = $options->{'request'}->url->path)
359 0 41 if exists $schema->{'servers'} and @{$schema->{'servers'}}
365 7 36 unless $uri_path =~ /^$path_pattern$/u
376 2 34 unless is_elements_unique(\@capture_names, $indexes)
380 2 32 if $options->{'path_captures'} and not is_equal($options->{'path_captures'}, \%path_captures)
385 2 30 unless exists $schema->{'paths'}{$path_template}{$method}
388 26 4 unless defined $options->{'operation_id'}
396 2 184 unless $path_template
406 4 180 if exists $options->{'path_captures'} and not is_equal([sort(keys %{$$options{"path_captures"}})], [sort(@capture_names)])
408 62 118 unless ($options->{'request'})
411 58 4 unless defined $options->{'operation_id'}
423 6 2 exists $options->{'path_template'} ? :
8 110 unless $uri_path =~ /^$path_pattern$/u
432 2 108 if exists $options->{'path_captures'} and not is_equal([map(($_ . ""), @$options->{'path_captures'}{@capture_names})], \@capture_values)
437 100 8 unless defined $options->{'operation_id'}
447 2 18 unless exists $$path_captures{$param_obj->{'name'}}
461 52 47 unless (exists $$query_params{$param_obj->{'name'}})
463 2 50 if $param_obj->{'required'}
469 1 46 if $param_obj->{'allowReserved'} // 0
476 3 49 if grep((fc $header_name eq fc $_), ("Accept", "Content-Type", "Authorization"))
481 8 41 unless (@$headers)
483 6 2 if $header_obj->{'required'}
495 24 80 if (exists $param_obj->{'content'})
497 0 24 if keys %{$$param_obj{"content"}} > 1
502 4 20 unless ($media_type_decoder)
504 2 2 XXX ? :
2 2 if XXX ? !keys(%$schema) : $schema
530 4 80 unless length $content_type
535 16 14 if m[([^/]+)/\*$]u
536 12 4 if not defined $media_type and exists $content_obj->{'*/*'}
537 4 76 unless defined $media_type
540 0 76 if (exists $content_obj->{$media_type}{'encoding'})
546 0 0 unless exists +($content_obj->{$media_type}{'schema'}{'properties'} // {})->{$property}
551 0 0 if $content_type =~ m[^multipart/]u or $content_type eq "application/x-www-form-urlencoded"
559 10 66 if ($content_type =~ m[^text/]u and my $charset = $message->content->charset)
574 12 60 if $media_type eq "*/*"
575 4 68 unless ($media_type_decoder)
577 2 2 XXX ? :
0 4 if not defined $schema or XXX ? !keys(%$schema) : $schema
591 2 62 unless defined $schema
606 11 177 $exception ? :
45 143 !@{$state->{'errors'}} ? :
613 10 82 unless $schema_info
617 2 80 if $state->{'depth'}++ > $self->evaluator->max_traversal_depth
620 2 78 if $schema_info->{'document'}->get_entity_at_location($schema_info->{'document_path'}) ne $entity_type
632 18 138 unless (XXX)
633 2 16 if $schema
636 6 0 $location[-2] eq 'header' ? :
2 6 $location[-2] eq 'path' ? :
2 8 $location[-2] eq 'query' ? :
6 10 $location[-1] eq 'body' ? :
645 6 132 unless keys %$schema
648 18 114 if (XXX and exists $schema->{'type'} and not XXX and grep(($schema->{'type'} eq $_), ('number', 'integer')) and &looks_like_number($data)) { }
80 36 elsif (defined $data and not XXX) { }
677 88 92 if $request->isa("Mojo::Message::Request")
678 92 0 if ($request->isa("HTTP::Request"))
680 88 4 unless (defined $request->headers->content_length)
682 29 59 if $length
692 26 27 if $response->isa("Mojo::Message::Response")
693 27 0 if ($response->isa("HTTP::Response"))
695 22 5 unless (defined $response->headers->content_length)
697 10 12 if $length