File: license_basic.rb

package info (click to toggle)
gitlab 17.6.5-19
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 629,368 kB
  • sloc: ruby: 1,915,304; javascript: 557,307; sql: 60,639; xml: 6,509; sh: 4,567; makefile: 1,239; python: 406
file content (19 lines) | stat: -rw-r--r-- 775 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

module API
  module Entities
    # Serializes a Gitlab::Git::DeclaredLicense
    class LicenseBasic < Grape::Entity
      expose :key, documentation: { type: 'string', example: 'gpl-3.0' }
      expose :name, documentation: { type: 'string', example: 'GNU General Public License v3.0' }
      expose :nickname, documentation: { type: 'string', example: 'GNU GPLv3' }
      expose :url, as: :html_url, documentation: { example: 'http://choosealicense.com/licenses/gpl-3.0' }

      # This was dropped:
      # https://github.com/github/choosealicense.com/commit/325806b42aa3d5b78e84120327ec877bc936dbdd#diff-66df8f1997786f7052d29010f2cbb4c66391d60d24ca624c356acc0ab986f139
      expose :source_url do |_|
        nil
      end
    end
  end
end