Extend Project API with link to readme
The root of the repository typically contains a readme with important information, but in order to access this via the API, an API consumer must first request the file list, detect which file is the readme (README
, README.md
, README.txt
etc), and then request the file. Given GitLab already detects the readme and shows a link on the project homepage, we should provide a way to programmatically retrieve the URL view readme.
This will allow applications to include a link to the readme in GitLab with having to scan the file tree, and then build the a URL based on the file path.
Proposal
Add a readme_url
attribute the Projects API route /projects/<id>
which returns a URL to open the readme the GitLab interface
{
"id": "12234"
...
"readme_url": "https://gitlab.com/gitlab-org/gitlab-ce/blob/master/README.md"
}
Links
https://docs.gitlab.com/ee/api/projects.html#get-single-project