API: expose issues project id
This commit is contained in:
parent
949b1df930
commit
f7dd067490
2 changed files with 6 additions and 1 deletions
|
@ -10,6 +10,7 @@ GET /issues
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"id": 43,
|
"id": 43,
|
||||||
|
"project_id": 8,
|
||||||
"title": "4xx/5xx pages",
|
"title": "4xx/5xx pages",
|
||||||
"description": "",
|
"description": "",
|
||||||
"labels": [ ],
|
"labels": [ ],
|
||||||
|
@ -28,6 +29,7 @@ GET /issues
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 42,
|
"id": 42,
|
||||||
|
"project_id": 8,
|
||||||
"title": "Add user settings",
|
"title": "Add user settings",
|
||||||
"description": "",
|
"description": "",
|
||||||
"labels": [
|
"labels": [
|
||||||
|
@ -91,6 +93,7 @@ Parameters:
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"id": 42,
|
"id": 42,
|
||||||
|
"project_id": 8,
|
||||||
"title": "Add user settings",
|
"title": "Add user settings",
|
||||||
"description": "",
|
"description": "",
|
||||||
"labels": [
|
"labels": [
|
||||||
|
|
|
@ -31,7 +31,9 @@ module Gitlab
|
||||||
end
|
end
|
||||||
|
|
||||||
class Issue < Grape::Entity
|
class Issue < Grape::Entity
|
||||||
expose :id, :title, :description
|
expose :id
|
||||||
|
expose (:project_id) {|issue| issue.project.id}
|
||||||
|
expose :title, :description
|
||||||
expose :label_list, :as => :labels
|
expose :label_list, :as => :labels
|
||||||
expose :milestone, :using => Entities::Milestone
|
expose :milestone, :using => Entities::Milestone
|
||||||
expose :assignee, :author, :using => Entities::UserBasic
|
expose :assignee, :author, :using => Entities::UserBasic
|
||||||
|
|
Loading…
Add table
Reference in a new issue