Commit f7dd067490fe57505f7226c3b54d3127d2f7fd46
1 parent
949b1df9
Exists in
master
and in
4 other branches
API: expose issues project id
Showing
2 changed files
with
6 additions
and
1 deletions
Show diff stats
doc/api/issues.md
... | ... | @@ -10,6 +10,7 @@ GET /issues |
10 | 10 | [ |
11 | 11 | { |
12 | 12 | "id": 43, |
13 | + "project_id": 8, | |
13 | 14 | "title": "4xx/5xx pages", |
14 | 15 | "description": "", |
15 | 16 | "labels": [ ], |
... | ... | @@ -28,6 +29,7 @@ GET /issues |
28 | 29 | }, |
29 | 30 | { |
30 | 31 | "id": 42, |
32 | + "project_id": 8, | |
31 | 33 | "title": "Add user settings", |
32 | 34 | "description": "", |
33 | 35 | "labels": [ |
... | ... | @@ -91,6 +93,7 @@ Parameters: |
91 | 93 | ```json |
92 | 94 | { |
93 | 95 | "id": 42, |
96 | + "project_id": 8, | |
94 | 97 | "title": "Add user settings", |
95 | 98 | "description": "", |
96 | 99 | "labels": [ | ... | ... |
lib/api/entities.rb
... | ... | @@ -31,7 +31,9 @@ module Gitlab |
31 | 31 | end |
32 | 32 | |
33 | 33 | class Issue < Grape::Entity |
34 | - expose :id, :title, :description | |
34 | + expose :id | |
35 | + expose (:project_id) {|issue| issue.project.id} | |
36 | + expose :title, :description | |
35 | 37 | expose :label_list, :as => :labels |
36 | 38 | expose :milestone, :using => Entities::Milestone |
37 | 39 | expose :assignee, :author, :using => Entities::UserBasic | ... | ... |