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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
4cb6a9bb
Commit
4cb6a9bb
authored
Jan 15, 2020
by
Andy Soiron
Committed by
Dmytro Zaporozhets
Jan 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return slug in /api/v4/projects/ID/services
parent
df14a8b0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
1 deletion
+16
-1
changelogs/unreleased/return_slug_in_api_services_index.yml
changelogs/unreleased/return_slug_in_api_services_index.yml
+5
-0
doc/api/services.md
doc/api/services.md
+3
-0
lib/api/entities.rb
lib/api/entities.rb
+5
-1
spec/fixtures/api/schemas/public_api/v4/service.json
spec/fixtures/api/schemas/public_api/v4/service.json
+1
-0
spec/requests/api/services_spec.rb
spec/requests/api/services_spec.rb
+2
-0
No files found.
changelogs/unreleased/return_slug_in_api_services_index.yml
0 → 100644
View file @
4cb6a9bb
---
title
:
Add slug to services API response
merge_request
:
22518
author
:
type
:
added
doc/api/services.md
View file @
4cb6a9bb
...
...
@@ -19,6 +19,7 @@ Example response:
{
"id"
:
75
,
"title"
:
"Jenkins CI"
,
"slug"
:
"jenkins"
,
"created_at"
:
"2019-11-20T11:20:25.297Z"
,
"updated_at"
:
"2019-11-20T12:24:37.498Z"
,
"active"
:
true
,
...
...
@@ -38,6 +39,7 @@ Example response:
{
"id"
:
76
,
"title"
:
"Alerts endpoint"
,
"slug"
:
"alerts"
,
"created_at"
:
"2019-11-20T11:20:25.297Z"
,
"updated_at"
:
"2019-11-20T12:24:37.498Z"
,
"active"
:
true
,
...
...
@@ -753,6 +755,7 @@ Example response:
{
"id"
:
4
,
"title"
:
"Slack slash commands"
,
"slug"
:
"slack-slash-commands"
,
"created_at"
:
"2017-06-27T05:51:39-07:00"
,
"updated_at"
:
"2017-06-27T05:51:39-07:00"
,
"active"
:
true
,
...
...
lib/api/entities.rb
View file @
4cb6a9bb
...
...
@@ -1129,7 +1129,11 @@ module API
end
class
ProjectServiceBasic
<
Grape
::
Entity
expose
:id
,
:title
,
:created_at
,
:updated_at
,
:active
expose
:id
,
:title
expose
:slug
do
|
service
|
service
.
to_param
.
dasherize
end
expose
:created_at
,
:updated_at
,
:active
expose
:commit_events
,
:push_events
,
:issues_events
,
:confidential_issues_events
expose
:merge_requests_events
,
:tag_push_events
,
:note_events
expose
:confidential_note_events
,
:pipeline_events
,
:wiki_page_events
...
...
spec/fixtures/api/schemas/public_api/v4/service.json
View file @
4cb6a9bb
...
...
@@ -3,6 +3,7 @@
"properties"
:
{
"id"
:
{
"type"
:
"integer"
},
"title"
:
{
"type"
:
"string"
},
"slug"
:
{
"type"
:
"string"
},
"created_at"
:
{
"type"
:
"date-time"
},
"updated_at"
:
{
"type"
:
"date-time"
},
"active"
:
{
"type"
:
"boolean"
},
...
...
spec/requests/api/services_spec.rb
View file @
4cb6a9bb
...
...
@@ -35,6 +35,7 @@ describe API::Services do
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
json_response
).
to
be_an
Array
expect
(
json_response
.
count
).
to
eq
(
1
)
expect
(
json_response
.
first
[
'slug'
]).
to
eq
(
'emails-on-push'
)
expect
(
response
).
to
match_response_schema
(
'public_api/v4/services'
)
end
end
...
...
@@ -61,6 +62,7 @@ describe API::Services do
put
api
(
"/projects/
#{
project
.
id
}
/services/
#{
dashed_service
}
?
#{
query_strings
}
"
,
user
),
params:
service_attrs
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
json_response
[
'slug'
]).
to
eq
(
dashed_service
)
events
.
each
do
|
event
|
next
if
event
==
"foo"
...
...
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