diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2016-12-12 08:58:13 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2016-12-12 08:58:13 +0000 |
commit | 87f3a66c32f8cab6c814f81ec9dfea69f64d79cc (patch) | |
tree | 3afd55ea01c39ab1341bf01dbadfe520618a4b6c /lib/api/entities.rb | |
parent | 221a461c1e917e816e30c213d48ad0ff87170527 (diff) | |
parent | fde754e2676e40dcf2600190983ef54030c5d5a5 (diff) | |
download | gitlab-ce-87f3a66c32f8cab6c814f81ec9dfea69f64d79cc.tar.gz |
Merge branch 'features/api-snippets' into 'master'
Adding support for personal snippet endpoint on the API
Closes #22042
See merge request !6373
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r-- | lib/api/entities.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 006d5f9f44e..01c0f5072ba 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -201,6 +201,19 @@ module API end end + class PersonalSnippet < Grape::Entity + expose :id, :title, :file_name + expose :author, using: Entities::UserBasic + expose :updated_at, :created_at + + expose :web_url do |snippet| + Gitlab::UrlBuilder.build(snippet) + end + expose :raw_url do |snippet| + Gitlab::UrlBuilder.build(snippet) + "/raw" + end + end + class ProjectEntity < Grape::Entity expose :id, :iid expose(:project_id) { |entity| entity.project.id } |