diff --git a/lib/Mojolicious/Plugin/OpenAPI.pm b/lib/Mojolicious/Plugin/OpenAPI.pm index eac36f9..3043799 100644 --- a/lib/Mojolicious/Plugin/OpenAPI.pm +++ b/lib/Mojolicious/Plugin/OpenAPI.pm @@ -203,7 +203,8 @@ sub _helper_get_spec { $jp ||= [paths => $s->{'openapi.path'}]; } - push @$jp, lc $c->req->method if $jp and $path ne 'for_path'; # Internal for now + my $method = lc $c->req->method; + push @$jp, ( $method eq 'head' ? 'get' : $method ) if $jp and $path ne 'for_path'; # Internal for now return $jp ? $self->validator->get($jp) : undef; }