Commit cadef802 authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Remain V3 endpoint unchanged

parent cc24682b
module API module API
class API < Grape::API class API < Grape::API
include APIGuard include APIGuard
version 'v3', using: :path
version %w(v3 v4), using: :path
version 'v3', using: :path do
mount ::API::V3::Projects
end
before { allow_access_with_scope :api } before { allow_access_with_scope :api }
......
This diff is collapsed.
This diff is collapsed.
...@@ -17,8 +17,8 @@ module ApiHelpers ...@@ -17,8 +17,8 @@ module ApiHelpers
# => "/api/v2/issues?foo=bar&private_token=..." # => "/api/v2/issues?foo=bar&private_token=..."
# #
# Returns the relative path to the requested API resource # Returns the relative path to the requested API resource
def api(path, user = nil) def api(path, user = nil, version: API::API.version)
"/api/#{API::API.version}#{path}" + "/api/#{version}#{path}" +
# Normalize query string # Normalize query string
(path.index('?') ? '' : '?') + (path.index('?') ? '' : '?') +
...@@ -31,6 +31,11 @@ module ApiHelpers ...@@ -31,6 +31,11 @@ module ApiHelpers
end end
end end
# Temporary helper method for simplifying V3 exclusive API specs
def v3_api(path, user = nil)
api(path, user, version: 'v3')
end
def ci_api(path, user = nil) def ci_api(path, user = nil)
"/ci/api/v1/#{path}" + "/ci/api/v1/#{path}" +
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment