debian-mirror-gitlab/lib/api/entities/issuable_references.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
562 B
Ruby
Raw Normal View History

2020-03-13 15:44:24 +05:30
# frozen_string_literal: true
module API
module Entities
class IssuableReferences < Grape::Entity
2023-03-04 22:38:38 +05:30
expose :short, documentation: { type: "string", example: "&6" } do |issuable|
2020-03-13 15:44:24 +05:30
issuable.to_reference
end
2023-03-04 22:38:38 +05:30
expose :relative, documentation: { type: "string", example: "&6" } do |issuable, options|
2020-03-13 15:44:24 +05:30
issuable.to_reference(options[:group] || options[:project])
end
2023-03-04 22:38:38 +05:30
expose :full, documentation: { type: "string", example: "test&6" } do |issuable|
2020-03-13 15:44:24 +05:30
issuable.to_reference(full: true)
end
end
end
end