diff options
Diffstat (limited to 'lib/api/entities/nuget/metadatum.rb')
-rw-r--r-- | lib/api/entities/nuget/metadatum.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/api/entities/nuget/metadatum.rb b/lib/api/entities/nuget/metadatum.rb index c316dfce740..1df57f8243d 100644 --- a/lib/api/entities/nuget/metadatum.rb +++ b/lib/api/entities/nuget/metadatum.rb @@ -7,8 +7,10 @@ module API expose :authors, documentation: { type: 'string', example: 'Authors' } do |metadatum| metadatum[:authors] || '' end - expose :description, as: :summary, documentation: { type: 'string', example: 'Description' } do |metadatum| - metadatum[:description] || '' + with_options documentation: { type: 'string', example: 'Description' } do + set_default = ->(metadatum) { metadatum[:description] || '' } + expose :description, &set_default + expose :description, as: :summary, &set_default end expose :project_url, as: :projectUrl, expose_nil: false, documentation: { type: 'string', example: 'http://sandbox.com/project' } expose :license_url, as: :licenseUrl, expose_nil: false, documentation: { type: 'string', example: 'http://sandbox.com/license' } |