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,6 +10,7 @@ GET /issues | ||
| 10 | [ | 10 | [ |
| 11 | { | 11 | { |
| 12 | "id": 43, | 12 | "id": 43, |
| 13 | + "project_id": 8, | ||
| 13 | "title": "4xx/5xx pages", | 14 | "title": "4xx/5xx pages", |
| 14 | "description": "", | 15 | "description": "", |
| 15 | "labels": [ ], | 16 | "labels": [ ], |
| @@ -28,6 +29,7 @@ GET /issues | @@ -28,6 +29,7 @@ GET /issues | ||
| 28 | }, | 29 | }, |
| 29 | { | 30 | { |
| 30 | "id": 42, | 31 | "id": 42, |
| 32 | + "project_id": 8, | ||
| 31 | "title": "Add user settings", | 33 | "title": "Add user settings", |
| 32 | "description": "", | 34 | "description": "", |
| 33 | "labels": [ | 35 | "labels": [ |
| @@ -91,6 +93,7 @@ Parameters: | @@ -91,6 +93,7 @@ Parameters: | ||
| 91 | ```json | 93 | ```json |
| 92 | { | 94 | { |
| 93 | "id": 42, | 95 | "id": 42, |
| 96 | + "project_id": 8, | ||
| 94 | "title": "Add user settings", | 97 | "title": "Add user settings", |
| 95 | "description": "", | 98 | "description": "", |
| 96 | "labels": [ | 99 | "labels": [ |
lib/api/entities.rb
| @@ -31,7 +31,9 @@ module Gitlab | @@ -31,7 +31,9 @@ module Gitlab | ||
| 31 | end | 31 | end |
| 32 | 32 | ||
| 33 | class Issue < Grape::Entity | 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 | expose :label_list, :as => :labels | 37 | expose :label_list, :as => :labels |
| 36 | expose :milestone, :using => Entities::Milestone | 38 | expose :milestone, :using => Entities::Milestone |
| 37 | expose :assignee, :author, :using => Entities::UserBasic | 39 | expose :assignee, :author, :using => Entities::UserBasic |