Backport parameters for API::Parameters

This backports the EE specific parameters for API::Parameters, wrapping
them in a conditional.
This commit is contained in:
Yorick Peterse 2019-03-25 15:47:55 +01:00
parent 449d2bb0d8
commit cbe21d78bf
No known key found for this signature in database
GPG Key ID: EDD30D2BEB691AC9
1 changed files with 8 additions and 0 deletions

View File

@ -55,6 +55,10 @@ module API
requires :key, type: String, desc: 'The key of the variable'
requires :value, type: String, desc: 'The value of the variable'
optional :protected, type: String, desc: 'Whether the variable is protected'
if Gitlab.ee?
optional :environment_scope, type: String, desc: 'The environment_scope of the variable'
end
end
post ':id/variables' do
variable_params = declared_params(include_missing: false)
@ -76,6 +80,10 @@ module API
optional :key, type: String, desc: 'The key of the variable'
optional :value, type: String, desc: 'The value of the variable'
optional :protected, type: String, desc: 'Whether the variable is protected'
if Gitlab.ee?
optional :environment_scope, type: String, desc: 'The environment_scope of the variable'
end
end
# rubocop: disable CodeReuse/ActiveRecord
put ':id/variables/:key' do