You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a route :id/repository/tags and a route :id/repository/tags/:tag_name, both generate the route helper api_v4_projects_repository_tags_path.
Calling api_v4_projects_repository_tags_path(id: 123) returns /api/v4/projects/123/repository/tags, but calling api_v4_projects_repository_tags_path(id: 123, tag_name: 'foo') returns the exact same path. While it actually should return /api/v4/projects/123/repository/tags/foo.
We have the grape endpoint defined get ':id/repository/tags' first and get ':id/repository/tags/:tag_name' below that. If we swap the order, the correct route helper is found and the correct path is returned depending on the parameters.
We have a route
:id/repository/tags
and a route:id/repository/tags/:tag_name
, both generate the route helperapi_v4_projects_repository_tags_path
.Calling
api_v4_projects_repository_tags_path(id: 123)
returns/api/v4/projects/123/repository/tags
, but callingapi_v4_projects_repository_tags_path(id: 123, tag_name: 'foo')
returns the exact same path. While it actually should return/api/v4/projects/123/repository/tags/foo
.We have the grape endpoint defined
get ':id/repository/tags'
first andget ':id/repository/tags/:tag_name'
below that. If we swap the order, the correct route helper is found and the correct path is returned depending on the parameters.See the full grape definition here:
https://gitlab.com/gitlab-org/gitlab-ce/blob/547b458e254bdb271d8ff41e62217fa7f3cf9c87/lib/api/tags.rb#L13-40
The text was updated successfully, but these errors were encountered: