The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

The author/ directory contains the logic for generating the v4.pm module.

DATA FILES

The author/config.yml drives the order and configuration of individual sections.

The YAML files in the author/sections/ directory have lines like this:

    - SUB: HTTP_METHOD PATH
    - SUB: RETURN = HTTP_METHOD PATH?

SUB

The name of the subroutine that will be created in v4.pm.

RETURN

The name of the return variable if any. This is used as part of generating the documentation. If no return variable is declared then the subroutine will return an empty list no matter what the API response returns.

HTTP_METHOD

One of GET, POST, PUT, or DELETE.

PATH

The path to the API endpoint (after the /api/v4 bit). The path is a list of static and dynamic strings separate by forward slashes. So, if you have:

    /foo/:bar/baz

Then the API subroutine would require one argument which would be injected in place of :bar.

?

If the PATH ends with a ? then this signifies that the API endpoint accepts query parameters.

GENERATING

To generate lib/GitLab/API/v4.pm do this:

    cd author
    perl generate.pl > ../lib/GitLab/API/v4.pm