diff options
Diffstat (limited to 'lib/api/entities/container_registry.rb')
-rw-r--r-- | lib/api/entities/container_registry.rb | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/api/entities/container_registry.rb b/lib/api/entities/container_registry.rb index d12c8142e69..cadd45cb0eb 100644 --- a/lib/api/entities/container_registry.rb +++ b/lib/api/entities/container_registry.rb @@ -4,9 +4,9 @@ module API module Entities module ContainerRegistry class Tag < Grape::Entity - expose :name - expose :path - expose :location + expose :name, documentation: { type: 'string', example: 'latest' } + expose :path, documentation: { type: 'string', example: 'namespace1/project1/test_image_1:latest' } + expose :location, documentation: { type: 'string', example: 'registry.dev/namespace1/project1/test_image_1:latest' } end class Repository < Grape::Entity @@ -19,10 +19,11 @@ module API expose :location, documentation: { type: 'string', example: 'gitlab.example.com/group/project/releases' } expose :created_at, documentation: { type: 'dateTime', example: '2019-01-10T13:39:08.229Z' } expose :expiration_policy_started_at, as: :cleanup_policy_started_at, documentation: { type: 'dateTime', example: '2020-08-17T03:12:35.489Z' } - expose :tags_count, if: -> (_, options) { options[:tags_count] } + expose :tags_count, if: -> (_, options) { options[:tags_count] }, documentation: { type: 'integer', example: 3 } expose :tags, using: Tag, if: -> (_, options) { options[:tags] } - expose :delete_api_path, if: ->(object, options) { Ability.allowed?(options[:user], :admin_container_image, object) } - expose :size, if: -> (_, options) { options[:size] } + expose :delete_api_path, if: ->(object, options) { Ability.allowed?(options[:user], :admin_container_image, object) }, + documentation: { type: 'string', example: 'delete/api/path' } + expose :size, if: -> (_, options) { options[:size] }, documentation: { type: 'integer', example: 12345 } private @@ -32,11 +33,11 @@ module API end class TagDetails < Tag - expose :revision - expose :short_revision - expose :digest - expose :created_at - expose :total_size + expose :revision, documentation: { type: 'string', example: 'tagrevision' } + expose :short_revision, documentation: { type: 'string', example: 'shortrevison' } + expose :digest, documentation: { type: 'string', example: 'shadigest' } + expose :created_at, documentation: { type: 'dateTime', example: '2022-01-10T13:39:08.229Z' } + expose :total_size, documentation: { type: 'integer', example: 3 } end end end |