bluefeet / GitLab-API-v4

A complete GitLab API v4 client.
https://metacpan.org/pod/GitLab::API::v4
Other
20 stars 23 forks source link

projects() shoud accept project_path #22

Closed guimard closed 5 years ago

guimard commented 6 years ago

Hello,

Thanks for writing this API. I had to write this to get a project by path:

sub GitLab::API::v4::project_by_path {                                              
    my $self = shift;                                                               
    return $self->_call_rest_client('GET', 'projects/%s', [shift], {});             
}

Coud you modify projects() method ?

Cheers, Xavier

bluefeet commented 6 years ago

I think you mean project(), not projects() (you are retrieving a single project, not many).

project() already accepts a $project_id.

Per https://metacpan.org/pod/GitLab::API::v4#Project-ID anywhere where a $project_id is accepted you /should/ be able to pass a path instead. Have you tried something like my $project = $api->project( $path ); ?