summaryrefslogtreecommitdiff
path: root/lib/api/entities.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r--lib/api/entities.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 6f9f71b0945..81bf7a8222b 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -162,7 +162,9 @@ module API
end
class MergeRequest < ProjectEntity
- expose :target_branch, :source_branch, :upvotes, :downvotes
+ expose :target_branch, :source_branch
+ # deprecated, always returns 0
+ expose :upvotes, :downvotes
expose :author, :assignee, using: Entities::UserBasic
expose :source_project_id, :target_project_id
expose :label_names, as: :labels
@@ -193,6 +195,8 @@ module API
expose :author, using: Entities::UserBasic
expose :created_at
expose :system?, as: :system
+ expose :noteable_id, :noteable_type
+ # upvote? and downvote? are deprecated, always return false
expose :upvote?, as: :upvote
expose :downvote?, as: :downvote
end
@@ -222,6 +226,8 @@ module API
expose :target_id, :target_type, :author_id
expose :data, :target_title
expose :created_at
+ expose :note, using: Entities::Note, if: ->(event, options) { event.note? }
+ expose :author, using: Entities::UserBasic, if: ->(event, options) { event.author }
expose :author_username do |event, options|
if event.author
@@ -325,7 +331,8 @@ module API
end
class Release < Grape::Entity
- expose :tag, :description
+ expose :tag, as: :tag_name
+ expose :description
end
class RepoTag < Grape::Entity