Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
cadef802
Commit
cadef802
authored
Jan 30, 2017
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remain V3 endpoint unchanged
parent
cc24682b
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1895 additions
and
3 deletions
+1895
-3
lib/api/api.rb
lib/api/api.rb
+6
-1
lib/api/v3/projects.rb
lib/api/v3/projects.rb
+458
-0
spec/requests/api/v3/projects_spec.rb
spec/requests/api/v3/projects_spec.rb
+1424
-0
spec/support/api_helpers.rb
spec/support/api_helpers.rb
+7
-2
No files found.
lib/api/api.rb
View file @
cadef802
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
}
...
...
lib/api/v3/projects.rb
0 → 100644
View file @
cadef802
This diff is collapsed.
Click to expand it.
spec/requests/api/v3/projects_spec.rb
0 → 100644
View file @
cadef802
This diff is collapsed.
Click to expand it.
spec/support/api_helpers.rb
View file @
cadef802
...
@@ -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
}
"
+
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment