Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/entities/user_basic.rb')
-rw-r--r--lib/api/entities/user_basic.rb19
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/api/entities/user_basic.rb b/lib/api/entities/user_basic.rb
index b8ee4e5a6e0..32e066b9f7e 100644
--- a/lib/api/entities/user_basic.rb
+++ b/lib/api/entities/user_basic.rb
@@ -3,16 +3,25 @@
module API
module Entities
class UserBasic < UserSafe
- expose :state
+ expose :state, documentation: { type: 'string', example: 'active' }
- expose :avatar_url do |user, options|
+ expose :avatar_url, documentation: { type: 'string', example: 'https://gravatar.com/avatar/1' } do |user, options|
user.avatar_url(only_path: false)
end
- expose :avatar_path, if: ->(user, options) { options.fetch(:only_path, false) && user.avatar_path }
- expose :custom_attributes, using: 'API::Entities::CustomAttribute', if: :with_custom_attributes
+ expose(
+ :avatar_path,
+ documentation: {
+ type: 'string',
+ example: '/user/avatar/28/The-Big-Lebowski-400-400.png'
+ },
+ if: ->(user, options) { options.fetch(:only_path, false) && user.avatar_path }
+ )
- expose :web_url do |user, options|
+ expose :custom_attributes, using: 'API::Entities::CustomAttribute', if: :with_custom_attributes,
+ documentation: { is_array: true }
+
+ expose :web_url, documentation: { type: 'string', example: 'https://gitlab.example.com/root' } do |user, options|
Gitlab::Routing.url_helpers.user_url(user)
end
end