Commit ee55e21a authored by James Lopez's avatar James Lopez

Merge branch 'refactoring-entities-file-29' into 'master'

Separate application and blob entities into own class files

See merge request gitlab-org/gitlab!24997
parents b6b9c976 aa931c12
---
title: Separate Application and Blob entities into own class files
merge_request: 24997
author: Rajendra Kadam
type: added
...@@ -215,34 +215,6 @@ module API ...@@ -215,34 +215,6 @@ module API
expose :expired?, as: :expired expose :expired?, as: :expired
expose :expiration expose :expiration
end end
class Application < Grape::Entity
expose :id
expose :uid, as: :application_id
expose :name, as: :application_name
expose :redirect_uri, as: :callback_url
expose :confidential
end
# Use with care, this exposes the secret
class ApplicationWithSecret < Application
expose :secret
end
class Blob < Grape::Entity
expose :basename
expose :data
expose :path
# TODO: :filename was renamed to :path but both still return the full path,
# in the future we can only return the filename here without the leading
# directory path.
# https://gitlab.com/gitlab-org/gitlab/issues/34521
expose :filename, &:path
expose :id
expose :ref
expose :startline
expose :project_id
end
end end
end end
......
# frozen_string_literal: true
module API
module Entities
class Application < Grape::Entity
expose :id
expose :uid, as: :application_id
expose :name, as: :application_name
expose :redirect_uri, as: :callback_url
expose :confidential
end
end
end
# frozen_string_literal: true
module API
module Entities
# Use with care, this exposes the secret
class ApplicationWithSecret < Entities::Application
expose :secret
end
end
end
# frozen_string_literal: true
module API
module Entities
class Blob < Grape::Entity
expose :basename
expose :data
expose :path
# TODO: :filename was renamed to :path but both still return the full path,
# in the future we can only return the filename here without the leading
# directory path.
# https://gitlab.com/gitlab-org/gitlab/issues/34521
expose :filename, &:path
expose :id
expose :ref
expose :startline
expose :project_id
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment