Commit 968c09ae authored by Nihad Abbasov's avatar Nihad Abbasov

API version returns last version set

  * fixed in grape v0.2.2
parent c177593e
...@@ -2,8 +2,7 @@ Dir["#{Rails.root}/lib/api/*.rb"].each {|file| require file} ...@@ -2,8 +2,7 @@ Dir["#{Rails.root}/lib/api/*.rb"].each {|file| require file}
module Gitlab module Gitlab
class API < Grape::API class API < Grape::API
VERSION = 'v2' version 'v2', using: :path
version VERSION, using: :path
rescue_from ActiveRecord::RecordNotFound do rescue_from ActiveRecord::RecordNotFound do
rack_response({'message' => '404 Not found'}.to_json, 404) rack_response({'message' => '404 Not found'}.to_json, 404)
......
...@@ -18,7 +18,7 @@ module ApiHelpers ...@@ -18,7 +18,7 @@ module ApiHelpers
# #
# 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)
"/api/#{Gitlab::API::VERSION}#{path}" + "/api/#{Gitlab::API.version}#{path}" +
# Normalize query string # Normalize query string
(path.index('?') ? '' : '?') + (path.index('?') ? '' : '?') +
......
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