Commit 79e94b68 authored by Rajendra Kadam's avatar Rajendra Kadam

Separate scope, detailed scope and dependecy classess into own class files

parent a5b6b2a8
......@@ -4,15 +4,11 @@ module EE
module API
module Entities
class Dependency < Grape::Entity
class Vulnerability < Grape::Entity
expose :name, :severity
end
expose :name, :version, :package_manager, :dependency_file_path
expose :dependency_file_path do |dependency|
dependency[:location][:path]
end
expose :vulnerabilities, using: Vulnerability, if: ->(_, opts) { can_read_vulnerabilities?(opts[:user], opts[:project]) }
expose :vulnerabilities, using: Dependency::Vulnerability, if: ->(_, opts) { can_read_vulnerabilities?(opts[:user], opts[:project]) }
private
......
# frozen_string_literal: true
module EE
module API
module Entities
class Dependency < Grape::Entity
class Vulnerability < Grape::Entity
expose :name, :severity
end
end
end
end
end
......@@ -4,24 +4,11 @@ module EE
module API
module Entities
class FeatureFlag < Grape::Entity
class Scope < Grape::Entity
expose :id
expose :active
expose :environment_scope
expose :strategies
expose :created_at
expose :updated_at
end
class DetailedScope < Scope
expose :name
end
expose :name
expose :description
expose :created_at
expose :updated_at
expose :scopes, using: Scope
expose :scopes, using: FeatureFlag::Scope
end
end
end
......
# frozen_string_literal: true
module EE
module API
module Entities
class FeatureFlag < Grape::Entity
class DetailedScope < Scope
expose :name
end
end
end
end
end
# frozen_string_literal: true
module EE
module API
module Entities
class FeatureFlag < Grape::Entity
class Scope < Grape::Entity
expose :id
expose :active
expose :environment_scope
expose :strategies
expose :created_at
expose :updated_at
end
end
end
end
end
\ No newline at end of file
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