简体   繁体   中英

Local instance of gitlab does not respond to REST-calls from the API documentation located in "/gitlab/doc/api/v4"

I have undertaking a master thesis project that uses the openapi.yaml files to auto generate test for REST-api web-services - This has lead me to host a local instance of gitlab, so that I can run the tool I am working on, on gitlab. For that to happen I need the .yaml files containing the documentation for the API calls. Such files are found within in the gitlab source-code, but the call does not seem to work.

Some calls work, namely:

http://localhost/api/v4/version http://localhost/api/v4/users http://localhost/api/v4/projects http://localhost/api/v4/groups

all returns meaningful JSON.

the problem is that a lot of the calls within the documentation does not work (returns a "404 not found"), namely:

http://localhost/api/v4/metadata http://localhost/api/v4/projects/{id}/access_tokens

and more calls specified in the documentation.

The problem is that a lot of the calls that work are not documented (all of the above except the 'version' call). I have really tried to look for an alternative openapi.yaml files, but with little success and I am also puzzled to why the one left in the actual source-code does not contain meaningful documentation. Have I overlooked something? I am currently using postman and providing a sudo authentication-token.

Thanks in advance - I must surely have overlooked something!

Currently I have tried to look for an alternative openapi.yaml both by googling and be browsing swaggerhub.com. I Have look at the documentation pages for gitlab, but I have not found anything I did not already have.

Unfortunately, at this time of writing, GitLab does not provide an OpenAPI spec for all of its API. Only a very small part of the API is documented in openapi.yml . There is an open issue that is tracking this improvement.

For now, the online API docs are going to be your best source of information available on using the GitLab API.

As for your problem of getting 404 responses, the most common cause of this is that the credentials you are using do not have permissions to the project/feature you are trying to access or you are not using a proper authentication method . Also keep in mind some features of the API require an appropriate license entitlement.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM