Branch Coverage

blib/lib/OpenAPI/Modern.pm
Criterion Covered Total %
branch 127 146 86.9


line true false branch
251 133 50 $request ? :
256 48 135 if (exists $options->{'method'}) { }
131 4 elsif ($request) { }
258 2 46 if $request and lc $request->method ne $method
265 131 50 if $request
268 20 161 if (exists $options->{'operation_id'})
271 2 18 unless $operation_path
272 2 16 unless $operation_path =~ m[^/paths/]u
278 2 14 if exists $options->{'path_template'} and $options->{'path_template'} ne $path_template
282 2 12 if $options->{'method'} and lc $options->{'method'} ne $method
284 2 10 if $request and lc $request->method ne $method
289 2 169 unless $method
293 150 19 if (exists $options->{'path_template'})
297 4 146 unless $path_item
301 2 144 unless $path_item->{$method}
305 9 2 if (not $path_template and $request and my $uri_path = _request_uri($request)->path)
308 0 9 if exists $schema->{'servers'} and @{$schema->{'servers'}}
312 2 7 unless $uri_path =~ /^$path_pattern$/u
321 2 5 if $options->{'path_captures'} and not is_equal($options->{'path_captures'}, \%path_captures)
330 2 152 unless $path_template
338 4 148 if exists $options->{'path_captures'} and not is_equal([sort(keys %{$$options{"path_captures"}})], [sort(@capture_names)])
340 42 106 unless ($request)
353 6 2 exists $options->{'path_template'} ? :
8 98 unless $uri_path =~ /^$path_pattern$/u
362 2 96 if exists $options->{'path_captures'} and not is_equal([map(($_ . ""), @$options->{'path_captures'}{@capture_names})], \@capture_values)
374 2 26 unless exists $$path_captures{$param_obj->{'name'}}
388 48 41 unless (exists $$query_params{$param_obj->{'name'}})
390 2 46 if $param_obj->{'required'}
396 1 40 if $param_obj->{'allowReserved'} // 0
403 3 39 if grep((fc $header_name eq fc $_), ("Accept", "Content-Type", "Authorization"))
408 8 31 unless (@$headers)
410 6 2 if $header_obj->{'required'}
422 24 72 if (exists $param_obj->{'content'})
424 0 24 if keys %{$$param_obj{"content"}} > 1
429 4 20 unless ($media_type_decoder)
431 0 4 XXX ? :
2 2 if XXX ? !keys(%$schema) : $schema
456 4 50 unless length $content_type
461 8 11 if m[([^/]+)/\*$]u
462 4 4 if not defined $media_type and exists $content_obj->{'*/*'}
463 4 46 unless defined $media_type
466 0 46 if (exists $content_obj->{$media_type}{'encoding'})
472 0 0 unless exists +($content_obj->{$media_type}{'schema'}{'properties'} // {})->{$property}
477 0 0 if $content_type =~ m[^multipart/]u or $content_type eq "application/x-www-form-urlencoded"
485 16 30 if (my $charset = _content_charset($message))
499 4 40 if $media_type eq "*/*"
500 4 40 unless ($media_type_decoder)
502 0 4 XXX ? :
0 4 if not defined $schema or XXX ? !keys(%$schema) : $schema
516 2 36 unless defined $schema
530 0 35 $self->evaluator->collect_annotations ? :
35 136 !@{$state->{'errors'}} ? :
537 10 82 unless $schema_info
541 2 80 if $state->{'depth'}++ > $self->evaluator->max_traversal_depth
552 106 16 XXX ? :
6 116 if XXX ? !keys(%$schema) : $schema
555 16 100 if (XXX and exists $schema->{'type'} and not XXX and grep(($schema->{'type'} eq $_), ('number', 'integer')) and &looks_like_number($data)) { }
78 24 elsif (defined $data and not XXX) { }
576 0 116 if $self->evaluator->collect_annotations
582 101 0 $request->isa('Mojo::Message::Request') ? :
102 101 $request->isa('HTTP::Request') ? :
589 44 0 $uri->isa('Mojo::URL') ? :
45 44 $uri->isa('URI') ? :
598 150 0 $message->isa('Mojo::Message') ? :
152 150 $message->isa('HTTP::Message') ? :
605 27 0 $message->isa('Mojo::Message') ? :
27 27 $message->isa('HTTP::Message') ? :
611 23 0 $message->isa('Mojo::Message') ? :
23 23 $message->isa('HTTP::Message') ? :
617 31 0 $message->isa('Mojo::Message') ? :
31 31 $message->isa('HTTP::Message') ? :
623 23 0 $message->isa('Mojo::Message') ? :
23 23 $message->isa('HTTP::Message') ? :