diff options
Diffstat (limited to 'lib/api/entities')
39 files changed, 471 insertions, 27 deletions
diff --git a/lib/api/entities/approvals.rb b/lib/api/entities/approvals.rb new file mode 100644 index 00000000000..74973772831 --- /dev/null +++ b/lib/api/entities/approvals.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module API + module Entities + class Approvals < Grape::Entity + expose :user, using: ::API::Entities::UserBasic + end + end +end diff --git a/lib/api/entities/basic_project_details.rb b/lib/api/entities/basic_project_details.rb index 13bc19456b3..cf0b32bed26 100644 --- a/lib/api/entities/basic_project_details.rb +++ b/lib/api/entities/basic_project_details.rb @@ -33,7 +33,8 @@ module API project.avatar_url(only_path: false) end - expose :star_count, :forks_count + expose :forks_count + expose :star_count expose :last_activity_at expose :namespace, using: 'API::Entities::NamespaceBasic' expose :custom_attributes, using: 'API::Entities::CustomAttribute', if: :with_custom_attributes diff --git a/lib/api/entities/conan_package/conan_package_manifest.rb b/lib/api/entities/conan_package/conan_package_manifest.rb new file mode 100644 index 00000000000..e6acfe1912f --- /dev/null +++ b/lib/api/entities/conan_package/conan_package_manifest.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module API + module Entities + module ConanPackage + class ConanPackageManifest < Grape::Entity + expose :package_urls, merge: true + end + end + end +end diff --git a/lib/api/entities/conan_package/conan_package_snapshot.rb b/lib/api/entities/conan_package/conan_package_snapshot.rb new file mode 100644 index 00000000000..d7fdda09b5a --- /dev/null +++ b/lib/api/entities/conan_package/conan_package_snapshot.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module API + module Entities + module ConanPackage + class ConanPackageSnapshot < Grape::Entity + expose :package_snapshot, merge: true + end + end + end +end diff --git a/lib/api/entities/conan_package/conan_recipe_manifest.rb b/lib/api/entities/conan_package/conan_recipe_manifest.rb new file mode 100644 index 00000000000..ecaa142cef9 --- /dev/null +++ b/lib/api/entities/conan_package/conan_recipe_manifest.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module API + module Entities + module ConanPackage + class ConanRecipeManifest < Grape::Entity + expose :recipe_urls, merge: true + end + end + end +end diff --git a/lib/api/entities/conan_package/conan_recipe_snapshot.rb b/lib/api/entities/conan_package/conan_recipe_snapshot.rb new file mode 100644 index 00000000000..09a60d23727 --- /dev/null +++ b/lib/api/entities/conan_package/conan_recipe_snapshot.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module API + module Entities + module ConanPackage + class ConanRecipeSnapshot < Grape::Entity + expose :recipe_snapshot, merge: true + end + end + end +end diff --git a/lib/api/entities/conan_package/conan_upload_urls.rb b/lib/api/entities/conan_package/conan_upload_urls.rb new file mode 100644 index 00000000000..c14963c87f5 --- /dev/null +++ b/lib/api/entities/conan_package/conan_upload_urls.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module API + module Entities + module ConanPackage + class ConanUploadUrls < Grape::Entity + expose :upload_urls, merge: true + end + end + end +end diff --git a/lib/api/entities/entity_helpers.rb b/lib/api/entities/entity_helpers.rb new file mode 100644 index 00000000000..3a68044ad35 --- /dev/null +++ b/lib/api/entities/entity_helpers.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module API + module Entities + module EntityHelpers + def can_read(attr, &block) + ->(obj, opts) { Ability.allowed?(opts[:user], "read_#{attr}".to_sym, yield(obj)) } + end + + def can_destroy(attr, &block) + ->(obj, opts) { Ability.allowed?(opts[:user], "destroy_#{attr}".to_sym, yield(obj)) } + end + + def expose_restricted(attr, &block) + expose attr, if: can_read(attr, &block) + end + end + end +end diff --git a/lib/api/entities/go_module_version.rb b/lib/api/entities/go_module_version.rb new file mode 100644 index 00000000000..643e25df9e0 --- /dev/null +++ b/lib/api/entities/go_module_version.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module API + module Entities + class GoModuleVersion < Grape::Entity + expose :name, as: 'Version' + expose :time, as: 'Time' + end + end +end diff --git a/lib/api/entities/group.rb b/lib/api/entities/group.rb index 8a6a5b7057c..e430eba4880 100644 --- a/lib/api/entities/group.rb +++ b/lib/api/entities/group.rb @@ -31,6 +31,7 @@ module API expose :wiki_size expose :lfs_objects_size expose :build_artifacts_size, as: :job_artifacts_size + expose :snippets_size end end end diff --git a/lib/api/entities/group_detail.rb b/lib/api/entities/group_detail.rb index 93dc41da81d..2d9d4ca7992 100644 --- a/lib/api/entities/group_detail.rb +++ b/lib/api/entities/group_detail.rb @@ -7,6 +7,7 @@ module API SharedGroupWithGroup.represent(group.shared_with_group_links.public_or_visible_to_user(group, options[:current_user])) end expose :runners_token, if: lambda { |group, options| options[:user_can_admin_group] } + expose :projects, using: Entities::Project do |group, options| projects = GroupProjectsFinder.new( group: group, diff --git a/lib/api/entities/issuable_entity.rb b/lib/api/entities/issuable_entity.rb index 5bee59de539..e2c674c0b8b 100644 --- a/lib/api/entities/issuable_entity.rb +++ b/lib/api/entities/issuable_entity.rb @@ -8,10 +8,38 @@ module API expose :title, :description expose :state, :created_at, :updated_at - # Avoids an N+1 query when metadata is included - def issuable_metadata(subject, options, method, args = nil) - cached_subject = options.dig(:issuable_metadata, subject.id) - (cached_subject || subject).public_send(method, *args) # rubocop: disable GitlabSecurity/PublicSend + def presented + lazy_issuable_metadata + + super + end + + def issuable_metadata + options.dig(:issuable_metadata, object.id) || lazy_issuable_metadata + end + + protected + + # This method will preload the `issuable_metadata` for the current + # entity according to the current top-level entity options, such + # as the current_user. + def lazy_issuable_metadata + BatchLoader.for(object).batch(key: [current_user, :issuable_metadata]) do |models, loader, args| + current_user = args[:key].first + + issuable_metadata = Gitlab::IssuableMetadata.new(current_user, models) + metadata_by_id = issuable_metadata.data + + models.each do |issuable| + loader.call(issuable, metadata_by_id[issuable.id]) + end + end + end + + private + + def current_user + options[:current_user] end end end diff --git a/lib/api/entities/issue_basic.rb b/lib/api/entities/issue_basic.rb index af92f4124f1..cf96c6556ec 100644 --- a/lib/api/entities/issue_basic.rb +++ b/lib/api/entities/issue_basic.rb @@ -21,10 +21,10 @@ module API issue.assignees.first end - expose(:user_notes_count) { |issue, options| issuable_metadata(issue, options, :user_notes_count) } - expose(:merge_requests_count) { |issue, options| issuable_metadata(issue, options, :merge_requests_count, options[:current_user]) } - expose(:upvotes) { |issue, options| issuable_metadata(issue, options, :upvotes) } - expose(:downvotes) { |issue, options| issuable_metadata(issue, options, :downvotes) } + expose(:user_notes_count) { |issue, options| issuable_metadata.user_notes_count } + expose(:merge_requests_count) { |issue, options| issuable_metadata.merge_requests_count } + expose(:upvotes) { |issue, options| issuable_metadata.upvotes } + expose(:downvotes) { |issue, options| issuable_metadata.downvotes } expose :due_date expose :confidential expose :discussion_locked diff --git a/lib/api/entities/merge_request_approvals.rb b/lib/api/entities/merge_request_approvals.rb new file mode 100644 index 00000000000..e3d58d687c4 --- /dev/null +++ b/lib/api/entities/merge_request_approvals.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module API + module Entities + class MergeRequestApprovals < Grape::Entity + expose :user_has_approved do |merge_request, options| + merge_request.approved_by?(options[:current_user]) + end + + expose :user_can_approve do |merge_request, options| + !merge_request.approved_by?(options[:current_user]) && + options[:current_user].can?(:approve_merge_request, merge_request) + end + + expose :approved do |merge_request| + merge_request.approvals.present? + end + + expose :approved_by, using: ::API::Entities::Approvals do |merge_request| + merge_request.approvals + end + end + end +end diff --git a/lib/api/entities/merge_request_basic.rb b/lib/api/entities/merge_request_basic.rb index 1643f267938..69523e3637b 100644 --- a/lib/api/entities/merge_request_basic.rb +++ b/lib/api/entities/merge_request_basic.rb @@ -22,13 +22,11 @@ module API MarkupHelper.markdown_field(entity, :description) end expose :target_branch, :source_branch - expose(:user_notes_count) { |merge_request, options| issuable_metadata(merge_request, options, :user_notes_count) } - expose(:upvotes) { |merge_request, options| issuable_metadata(merge_request, options, :upvotes) } - expose(:downvotes) { |merge_request, options| issuable_metadata(merge_request, options, :downvotes) } - expose :assignee, using: ::API::Entities::UserBasic do |merge_request| - merge_request.assignee - end - expose :author, :assignees, using: Entities::UserBasic + expose(:user_notes_count) { |merge_request, options| issuable_metadata.user_notes_count } + expose(:upvotes) { |merge_request, options| issuable_metadata.upvotes } + expose(:downvotes) { |merge_request, options| issuable_metadata.downvotes } + + expose :author, :assignees, :assignee, using: Entities::UserBasic expose :source_project_id, :target_project_id expose :labels do |merge_request, options| if options[:with_labels_details] @@ -57,9 +55,12 @@ module API expose :discussion_locked expose :should_remove_source_branch?, as: :should_remove_source_branch expose :force_remove_source_branch?, as: :force_remove_source_branch - expose :allow_collaboration, if: -> (merge_request, _) { merge_request.for_fork? } - # Deprecated - expose :allow_collaboration, as: :allow_maintainer_to_push, if: -> (merge_request, _) { merge_request.for_fork? } + + with_options if: -> (merge_request, _) { merge_request.for_fork? } do + expose :allow_collaboration + # Deprecated + expose :allow_collaboration, as: :allow_maintainer_to_push + end # reference is deprecated in favour of references # Introduced [Gitlab 12.6](https://gitlab.com/gitlab-org/gitlab/merge_requests/20354) diff --git a/lib/api/entities/npm_package.rb b/lib/api/entities/npm_package.rb new file mode 100644 index 00000000000..b094f3acdb6 --- /dev/null +++ b/lib/api/entities/npm_package.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module API + module Entities + class NpmPackage < Grape::Entity + expose :name + expose :versions + expose :dist_tags, as: 'dist-tags' + end + end +end diff --git a/lib/api/entities/npm_package_tag.rb b/lib/api/entities/npm_package_tag.rb new file mode 100644 index 00000000000..7f458fa037f --- /dev/null +++ b/lib/api/entities/npm_package_tag.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module API + module Entities + class NpmPackageTag < Grape::Entity + expose :dist_tags, merge: true + end + end +end diff --git a/lib/api/entities/nuget/dependency.rb b/lib/api/entities/nuget/dependency.rb new file mode 100644 index 00000000000..b61c37f5882 --- /dev/null +++ b/lib/api/entities/nuget/dependency.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module API + module Entities + module Nuget + class Dependency < Grape::Entity + expose :id, as: :@id + expose :type, as: :@type + expose :name, as: :id + expose :range + end + end + end +end diff --git a/lib/api/entities/nuget/dependency_group.rb b/lib/api/entities/nuget/dependency_group.rb new file mode 100644 index 00000000000..dcab9359fcf --- /dev/null +++ b/lib/api/entities/nuget/dependency_group.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module API + module Entities + module Nuget + class DependencyGroup < Grape::Entity + expose :id, as: :@id + expose :type, as: :@type + expose :target_framework, as: :targetFramework, expose_nil: false + expose :dependencies, using: ::API::Entities::Nuget::Dependency + end + end + end +end diff --git a/lib/api/entities/nuget/metadatum.rb b/lib/api/entities/nuget/metadatum.rb new file mode 100644 index 00000000000..87caef41a85 --- /dev/null +++ b/lib/api/entities/nuget/metadatum.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module API + module Entities + module Nuget + class Metadatum < Grape::Entity + expose :project_url, as: :projectUrl, expose_nil: false + expose :license_url, as: :licenseUrl, expose_nil: false + expose :icon_url, as: :iconUrl, expose_nil: false + end + end + end +end diff --git a/lib/api/entities/nuget/package_metadata.rb b/lib/api/entities/nuget/package_metadata.rb new file mode 100644 index 00000000000..e1c2a1ae161 --- /dev/null +++ b/lib/api/entities/nuget/package_metadata.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module API + module Entities + module Nuget + class PackageMetadata < Grape::Entity + expose :json_url, as: :@id + expose :archive_url, as: :packageContent + expose :catalog_entry, as: :catalogEntry, using: ::API::Entities::Nuget::PackageMetadataCatalogEntry + end + end + end +end diff --git a/lib/api/entities/nuget/package_metadata_catalog_entry.rb b/lib/api/entities/nuget/package_metadata_catalog_entry.rb new file mode 100644 index 00000000000..5533f857596 --- /dev/null +++ b/lib/api/entities/nuget/package_metadata_catalog_entry.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module API + module Entities + module Nuget + class PackageMetadataCatalogEntry < Grape::Entity + expose :json_url, as: :@id + expose :authors + expose :dependency_groups, as: :dependencyGroups, using: ::API::Entities::Nuget::DependencyGroup + expose :package_name, as: :id + expose :package_version, as: :version + expose :tags + expose :archive_url, as: :packageContent + expose :summary + expose :metadatum, using: ::API::Entities::Nuget::Metadatum, merge: true + end + end + end +end diff --git a/lib/api/entities/nuget/packages_metadata.rb b/lib/api/entities/nuget/packages_metadata.rb new file mode 100644 index 00000000000..1cdf2491725 --- /dev/null +++ b/lib/api/entities/nuget/packages_metadata.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module API + module Entities + module Nuget + class PackagesMetadata < Grape::Entity + expose :count + expose :items, using: ::API::Entities::Nuget::PackagesMetadataItem + end + end + end +end diff --git a/lib/api/entities/nuget/packages_metadata_item.rb b/lib/api/entities/nuget/packages_metadata_item.rb new file mode 100644 index 00000000000..84cc79166f3 --- /dev/null +++ b/lib/api/entities/nuget/packages_metadata_item.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module API + module Entities + module Nuget + class PackagesMetadataItem < Grape::Entity + expose :json_url, as: :@id + expose :lower_version, as: :lower + expose :upper_version, as: :upper + expose :packages_count, as: :count + expose :packages, as: :items, using: ::API::Entities::Nuget::PackageMetadata + end + end + end +end diff --git a/lib/api/entities/nuget/packages_versions.rb b/lib/api/entities/nuget/packages_versions.rb new file mode 100644 index 00000000000..498c6970d5c --- /dev/null +++ b/lib/api/entities/nuget/packages_versions.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module API + module Entities + module Nuget + class PackagesVersions < Grape::Entity + expose :versions + end + end + end +end diff --git a/lib/api/entities/nuget/search_result.rb b/lib/api/entities/nuget/search_result.rb new file mode 100644 index 00000000000..8e028cbad95 --- /dev/null +++ b/lib/api/entities/nuget/search_result.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module API + module Entities + module Nuget + class SearchResult < Grape::Entity + expose :type, as: :@type + expose :authors + expose :name, as: :id + expose :name, as: :title + expose :summary + expose :total_downloads, as: :totalDownloads + expose :verified + expose :version + expose :versions, using: ::API::Entities::Nuget::SearchResultVersion + expose :tags + expose :metadatum, using: ::API::Entities::Nuget::Metadatum, merge: true + end + end + end +end diff --git a/lib/api/entities/nuget/search_result_version.rb b/lib/api/entities/nuget/search_result_version.rb new file mode 100644 index 00000000000..9032c964c44 --- /dev/null +++ b/lib/api/entities/nuget/search_result_version.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module API + module Entities + module Nuget + class SearchResultVersion < Grape::Entity + expose :json_url, as: :@id + expose :version + expose :downloads + end + end + end +end diff --git a/lib/api/entities/nuget/search_results.rb b/lib/api/entities/nuget/search_results.rb new file mode 100644 index 00000000000..22a77dc7b6c --- /dev/null +++ b/lib/api/entities/nuget/search_results.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module API + module Entities + module Nuget + class SearchResults < Grape::Entity + expose :total_count, as: :totalHits + expose :data, using: ::API::Entities::Nuget::SearchResult + end + end + end +end diff --git a/lib/api/entities/nuget/service_index.rb b/lib/api/entities/nuget/service_index.rb new file mode 100644 index 00000000000..e57bd04adb9 --- /dev/null +++ b/lib/api/entities/nuget/service_index.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module API + module Entities + module Nuget + class ServiceIndex < Grape::Entity + expose :version + expose :resources + end + end + end +end diff --git a/lib/api/entities/package.rb b/lib/api/entities/package.rb new file mode 100644 index 00000000000..73473f16da9 --- /dev/null +++ b/lib/api/entities/package.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module API + module Entities + class Package < Grape::Entity + include ::API::Helpers::RelatedResourcesHelpers + extend ::API::Entities::EntityHelpers + + expose :id + expose :name + expose :version + expose :package_type + + expose :_links do + expose :web_path do |package| + if ::Gitlab.ee? + ::Gitlab::Routing.url_helpers.project_package_path(package.project, package) + end + end + + expose :delete_api_path, if: can_destroy(:package, &:project) do |package| + expose_url api_v4_projects_packages_path(package_id: package.id, id: package.project_id) + end + end + + expose :created_at + expose :project_id, if: ->(_, opts) { opts[:group] } + expose :project_path, if: ->(obj, opts) { opts[:group] && Ability.allowed?(opts[:user], :read_project, obj.project) } + expose :tags + + expose :pipeline, if: ->(package) { package.build_info }, using: Package::Pipeline + + expose :versions, using: ::API::Entities::PackageVersion + + private + + def project_path + object.project.full_path + end + end + end +end diff --git a/lib/api/entities/package/pipeline.rb b/lib/api/entities/package/pipeline.rb new file mode 100644 index 00000000000..e91a12e47fa --- /dev/null +++ b/lib/api/entities/package/pipeline.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module API + module Entities + class Package < Grape::Entity + class Pipeline < ::API::Entities::PipelineBasic + expose :user, using: ::API::Entities::UserBasic + end + end + end +end diff --git a/lib/api/entities/package_file.rb b/lib/api/entities/package_file.rb new file mode 100644 index 00000000000..8be4e5a4316 --- /dev/null +++ b/lib/api/entities/package_file.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module API + module Entities + class PackageFile < Grape::Entity + expose :id, :package_id, :created_at + expose :file_name, :size + expose :file_md5, :file_sha1 + end + end +end diff --git a/lib/api/entities/package_version.rb b/lib/api/entities/package_version.rb new file mode 100644 index 00000000000..5f3e86c3229 --- /dev/null +++ b/lib/api/entities/package_version.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module API + module Entities + class PackageVersion < Grape::Entity + expose :id + expose :version + expose :created_at + expose :tags + + expose :pipeline, if: ->(package) { package.build_info }, using: Package::Pipeline + end + end +end diff --git a/lib/api/entities/project.rb b/lib/api/entities/project.rb index 55a57501858..e3c5177cd0b 100644 --- a/lib/api/entities/project.rb +++ b/lib/api/entities/project.rb @@ -51,6 +51,8 @@ module API expose(:wiki_enabled) { |project, options| project.feature_available?(:wiki, options[:current_user]) } expose(:jobs_enabled) { |project, options| project.feature_available?(:builds, options[:current_user]) } expose(:snippets_enabled) { |project, options| project.feature_available?(:snippets, options[:current_user]) } + expose :service_desk_enabled + expose :service_desk_address expose(:can_create_merge_request_in) do |project, options| Ability.allowed?(options[:current_user], :create_merge_request_in, project) diff --git a/lib/api/entities/project_statistics.rb b/lib/api/entities/project_statistics.rb index e5f6165da31..32201e88eaf 100644 --- a/lib/api/entities/project_statistics.rb +++ b/lib/api/entities/project_statistics.rb @@ -9,6 +9,7 @@ module API expose :wiki_size expose :lfs_objects_size expose :build_artifacts_size, as: :job_artifacts_size + expose :snippets_size end end end diff --git a/lib/api/entities/release.rb b/lib/api/entities/release.rb index 99fa496d368..afe14cf33cf 100644 --- a/lib/api/entities/release.rb +++ b/lib/api/entities/release.rb @@ -5,9 +5,7 @@ module API class Release < Grape::Entity include ::API::Helpers::Presentable - expose :name do |release, _| - can_download_code? ? release.name : "Release-#{release.id}" - end + expose :name expose :tag, as: :tag_name, if: ->(_, _) { can_download_code? } expose :description expose :description_html do |entity| @@ -23,10 +21,7 @@ module API expose :tag_path, expose_nil: false expose :assets do - expose :assets_count, as: :count do |release, _| - assets_to_exclude = can_download_code? ? [] : [:sources] - release.assets_count(except: assets_to_exclude) - end + expose :assets_count, as: :count expose :sources, using: Entities::Releases::Source, if: ->(_, _) { can_download_code? } expose :links, using: Entities::Releases::Link do |release, options| release.links.sorted diff --git a/lib/api/entities/resource_state_event.rb b/lib/api/entities/resource_state_event.rb new file mode 100644 index 00000000000..f71a38e4115 --- /dev/null +++ b/lib/api/entities/resource_state_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module API + module Entities + class ResourceStateEvent < Grape::Entity + expose :id + expose :user, using: Entities::UserBasic + expose :created_at + expose :resource_type do |event, _options| + event.issuable.class.name + end + expose :resource_id do |event, _options| + event.issuable.id + end + expose :state + end + end +end diff --git a/lib/api/entities/snippet.rb b/lib/api/entities/snippet.rb index 19c89603cbc..40488eb882d 100644 --- a/lib/api/entities/snippet.rb +++ b/lib/api/entities/snippet.rb @@ -17,6 +17,18 @@ module API expose :file_name do |snippet| snippet.file_name_on_repo || snippet.file_name end + expose :files, if: ->(snippet, options) { snippet_multiple_files?(snippet, options[:current_user]) } do |snippet, options| + snippet.list_files.map do |file| + { + path: file, + raw_url: Gitlab::UrlBuilder.build(snippet, file: file, ref: snippet.repository.root_ref) + } + end + end + + def snippet_multiple_files?(snippet, current_user) + ::Feature.enabled?(:snippet_multiple_files, current_user) && snippet.repository_exists? + end end end end diff --git a/lib/api/entities/user.rb b/lib/api/entities/user.rb index adf954ab02d..4aa5c9b7236 100644 --- a/lib/api/entities/user.rb +++ b/lib/api/entities/user.rb @@ -5,7 +5,7 @@ module API class User < UserBasic include UsersHelper expose :created_at, if: ->(user, opts) { Ability.allowed?(opts[:current_user], :read_user_profile, user) } - expose :bio, :location, :public_email, :skype, :linkedin, :twitter, :website_url, :organization, :job_title + expose :bio, :bio_html, :location, :public_email, :skype, :linkedin, :twitter, :website_url, :organization, :job_title expose :work_information do |user| work_information(user) end |