Branch Coverage

blib/lib/OpenAPI/Modern.pm
Criterion Covered Total %
branch 123 142 86.6


line true false branch
252 48 135 if (exists $options->{'method'}) { }
131 4 elsif ($request) { }
254 2 46 if $request and lc $request->method ne $method
262 20 161 if (exists $options->{'operation_id'})
265 2 18 unless $operation_path
266 2 16 unless $operation_path =~ m[^/paths/]u
272 2 14 if exists $options->{'path_template'} and $options->{'path_template'} ne $path_template
276 2 12 if $options->{'method'} and lc $options->{'method'} ne $method
278 2 10 if $request and lc $request->method ne $method
283 2 169 unless $method
287 150 19 if (exists $options->{'path_template'})
291 4 146 unless $path_item
295 2 144 unless $path_item->{$method}
299 9 2 if (not $path_template and $request and my $uri_path = _request_uri($request)->path)
302 0 9 if exists $schema->{'servers'} and @{$schema->{'servers'}}
306 2 7 unless $uri_path =~ /^$path_pattern$/u
315 2 5 if $options->{'path_captures'} and not is_equal($options->{'path_captures'}, \%path_captures)
324 2 152 unless $path_template
332 4 148 if exists $options->{'path_captures'} and not is_equal([sort(keys %{$$options{"path_captures"}})], [sort(@capture_names)])
334 42 106 unless ($request)
347 6 2 exists $options->{'path_template'} ? :
8 98 unless $uri_path =~ /^$path_pattern$/u
356 2 96 if exists $options->{'path_captures'} and not is_equal([map(($_ . ""), @$options->{'path_captures'}{@capture_names})], \@capture_values)
368 2 26 unless exists $$path_captures{$param_obj->{'name'}}
382 48 41 unless (exists $$query_params{$param_obj->{'name'}})
384 2 46 if $param_obj->{'required'}
390 1 40 if $param_obj->{'allowReserved'} // 0
397 3 39 if grep((fc $header_name eq fc $_), ("Accept", "Content-Type", "Authorization"))
402 8 31 unless (@$headers)
404 6 2 if $header_obj->{'required'}
416 24 72 if (exists $param_obj->{'content'})
418 0 24 if keys %{$$param_obj{"content"}} > 1
423 4 20 unless ($media_type_decoder)
425 0 4 XXX ? :
2 2 if XXX ? !keys(%$schema) : $schema
450 4 50 unless length $content_type
455 8 13 if m[([^/]+)/\*$]u
456 4 4 if not defined $media_type and exists $content_obj->{'*/*'}
457 4 46 unless defined $media_type
460 0 46 if (exists $content_obj->{$media_type}{'encoding'})
466 0 0 unless exists +($content_obj->{$media_type}{'schema'}{'properties'} // {})->{$property}
471 0 0 if $content_type =~ m[^multipart/]u or $content_type eq "application/x-www-form-urlencoded"
479 16 30 if (my $charset = _content_charset($message))
493 4 40 if $media_type eq "*/*"
494 4 40 unless ($media_type_decoder)
496 0 4 XXX ? :
0 4 if not defined $schema or XXX ? !keys(%$schema) : $schema
510 2 36 unless defined $schema
524 0 35 $self->evaluator->collect_annotations ? :
35 136 !@{$state->{'errors'}} ? :
531 10 82 unless $schema_info
535 2 80 if $state->{'depth'}++ > $self->evaluator->max_traversal_depth
546 106 16 XXX ? :
6 116 if XXX ? !keys(%$schema) : $schema
549 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) { }
569 0 116 if $self->evaluator->collect_annotations
575 101 0 $request->isa('Mojo::Message::Request') ? :
102 101 $request->isa('HTTP::Request') ? :
582 44 0 $uri->isa('Mojo::URL') ? :
45 44 $uri->isa('URI') ? :
590 19 0 $message->isa('Mojo::Message') ? :
19 19 $message->isa('HTTP::Message') ? :
597 27 0 $message->isa('Mojo::Message') ? :
27 27 $message->isa('HTTP::Message') ? :
603 23 0 $message->isa('Mojo::Message') ? :
23 23 $message->isa('HTTP::Message') ? :
609 31 0 $message->isa('Mojo::Message') ? :
31 31 $message->isa('HTTP::Message') ? :
615 23 0 $message->isa('Mojo::Message') ? :
23 23 $message->isa('HTTP::Message') ? :