Skip to content

Fix curl example request method of Namespace list API

What does this MR do?

Fix a typo in documentation. The Namespace list API should be GET method, not a PUT method.

The grape routes suggests this is a GET method:

$ bin/rails grape:routes | grep "namespaces list" 
GET /api/:version/namespaces(.:format) - Get a namespaces list

Another document page(https://docs.gitlab.com/ee/api/namespaces.html#list-namespaces) also suggests this is a GET method.

Also confirmed on my local development environment:

$ curl --request GET --header "PRIVATE-TOKEN: N6-5z8kX1Cf6kXaoxzNZ" "http://localhost:3000/api/v4/namespaces?per_page=1"
[{"id":1,"name":"Administrator Lastname","path":"root","kind":"user","full_path":"root","parent_id":null,"avatar_url":"https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon","web_url":"http://192.168.0.64:3000/root","shared_runners_minutes_limit":10000,"extra_shared_runners_minutes_limit":null,"additional_purchased_storage_size":0,"additional_purchased_storage_ends_on":null,"billable_members_count":1,"seats_in_use":1,"max_seats_used":1,"plan":"premium","trial_ends_on":null,"trial":false}]


$ curl --request PUT --header "PRIVATE-TOKEN: N6-5z8kX1Cf6kXaoxzNZ" "http://localhost:3000/api/v4/namespaces?per_page=1"
{"error":"404 Not Found"}

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Qingyu Zhao

Merge request reports

Loading