From dcdfa04b322db3905f6871a6857e7055c556547f Mon Sep 17 00:00:00 2001 From: Jan Provaznik Date: Wed, 28 Feb 2018 08:48:23 +0100 Subject: Add discussion API * adds basic discussions API for issues and snippets * reorganizes notes specs (so same tests can be used for all noteable types - issues, MRs, snippets) --- lib/api/entities.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/api/entities.rb') diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 0c8ec7dd5f5..aa96033898b 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -629,6 +629,7 @@ module API NOTEABLE_TYPES_WITH_IID = %w(Issue MergeRequest).freeze expose :id + expose :type expose :note, as: :body expose :attachment_identifier, as: :attachment expose :author, using: Entities::UserBasic @@ -640,6 +641,12 @@ module API expose(:noteable_iid) { |note| note.noteable.iid if NOTEABLE_TYPES_WITH_IID.include?(note.noteable_type) } end + class Discussion < Grape::Entity + expose :id + expose :individual_note?, as: :individual_note + expose :notes, using: Entities::Note + end + class AwardEmoji < Grape::Entity expose :id expose :name -- cgit v1.2.1