The author/
directory contains the logic for generating the v3.pm module.
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?
The name if the subroutine that will be created in v3.pm.
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.
One of GET, POST, PUT, or DELETE.
The path to the API endpoint (after the /api/v3 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.
To generate lib/GitLab/API/v3.pm
do this:
cd author
perl generate.pl > ../lib/GitLab/API/v3.pm