debian-mirror-gitlab/app/serializers/project_entity.rb
2023-01-12 18:35:48 +00:00

16 lines
491 B
Ruby

# frozen_string_literal: true
class ProjectEntity < Grape::Entity
include RequestAwareEntity
expose :id, documentation: { type: 'integer', example: 1 }
expose :name, documentation: { type: 'string', example: 'GitLab' }
expose :full_path, documentation: { type: 'string', example: 'gitlab-org/gitlab' } do |project|
project_path(project)
end
expose :full_name, documentation: { type: 'string', example: 'GitLab Org / GitLab' } do |project|
project.full_name
end
end