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
path: root/lib/api
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2019-01-02 13:56:03 +0300
committerShinya Maeda <shinya@gitlab.com>2019-01-04 16:17:03 +0300
commitdf7ed9eef2048c9a2f79860e00a69f84fa92e10e (patch)
tree58af696ab41bf8a9649f4c60b7663ec11bd496ec /lib/api
parent8a14548fc741e8d115d99e8303e36ed83660494d (diff)
Add unique constraint to release and url
Fix coding style Improve coding style Decouple UPDATE and DELETE operations of asset links Rename links_attributes to assets:links Rename exposed param and updated spec
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/releases.rb15
1 files changed, 5 insertions, 10 deletions
diff --git a/lib/api/releases.rb b/lib/api/releases.rb
index 63c755f3620..c3d4101528c 100644
--- a/lib/api/releases.rb
+++ b/lib/api/releases.rb
@@ -49,9 +49,11 @@ module API
requires :name, type: String, desc: 'The name of the release'
requires :description, type: String, desc: 'The release notes'
optional :ref, type: String, desc: 'The commit sha or branch name'
- optional :links_attributes, type: Array do
- requires :name, type: String
- requires :url, type: String
+ optional :assets, type: Hash do
+ optional :links, type: Array do
+ requires :name, type: String
+ requires :url, type: String
+ end
end
end
post ':id/releases' do
@@ -76,13 +78,6 @@ module API
requires :tag_name, type: String, desc: 'The name of the tag', as: :tag
optional :name, type: String, desc: 'The name of the release'
optional :description, type: String, desc: 'Release notes with markdown support'
- optional :links_attributes, type: Array do
- optional :id, type: Integer
- optional :name, type: String
- optional :url, type: String
- optional :_destroy, type: Integer
- at_least_one_of :name, :url, :_destroy
- end
end
put ':id/releases/:tag_name', requirements: RELEASE_ENDPOINT_REQUIREMETS do
authorize_update_release!