Branch Coverage

blib/lib/Yancy/Plugin/OpenAPI.pm
Criterion Covered Total %
branch 42 64 65.6


line true false branch
97 0 2 if $pathspec->{'x-schema'}
102 2 3 if ($method eq 'get') { }
2 1 elsif ($method =~ /^(put|post)$/u) { }
106 0 2 unless $schema = $response_spec->{'schema'}
109 0 2 unless $op_spec->{'parameters'}
110 1 1 unless $pathspec->{'parameters'}
112 0 2 if @body_params > 1
113 0 2 unless $schema = $body_params[0]{'schema'}
118 2 3 unless my $this_ref = $schema->{'$ref'} || $schema->{'items'} && $schema->{'items'}{'$ref'} || $schema->{'properties'} && $schema->{'properties'}{'items'} && $schema->{'properties'}{'items'}{'$ref'}
119 0 3 unless $this_ref =~ s[^#/definitions/][]u
120 0 3 if $this_ref and $schema_name and $this_ref ne $schema_name
124 0 2 unless ($schema_name)
126 0 0 unless $schema_name
138 0 2 unless $spec->{'definitions'}{$schema}
157 2 3 unless $pathspec->{'parameters'}
158 2 3 unless $op_spec->{'parameters'}
163 2 3 if ($method eq 'get') { }
1 2 elsif ($method eq 'post') { }
1 1 elsif ($method eq 'put') { }
1 0 elsif ($method eq 'delete') { }
165 1 1 if ($id_field) { }
187 0 1 unless $id_field
194 0 1 unless $id_field
240 0 1 if $schema->{'x-ignore'}
242 0 1 ref $id_field eq 'ARRAY' ? :
264 0 3 ref $props{$_}{'type'} eq 'ARRAY' ? :
265 0 2 $type eq 'array' ? :
0 2 $type eq 'boolean' ? :
1 2 $type eq 'number' || $type eq 'integer' ? :
332 0 1 @id_fields > 1 ? :
0 1 $schema->{'x-view'} ? :
370 0 1 $schema->{'x-view'} ? :