diff --git a/ee/lib/api/experiments.rb b/ee/lib/api/experiments.rb index c4893e0a7d06e1ec6ed919367b845d36af60fb87..bbf7187d76feb32e3db5571131b701a235050f2c 100644 --- a/ee/lib/api/experiments.rb +++ b/ee/lib/api/experiments.rb @@ -7,8 +7,12 @@ class Experiments < ::API::Base feature_category :experimentation_expansion resource :experiments do - desc 'Get a list of all experiments' do + desc 'List all experiments' do + detail 'Get a list of all experiments. Each experiment has an enabled status that indicates whether'\ + 'the experiment is enabled globally, or only in specific contexts.' success EE::API::Entities::Experiment + is_array true + tags %w[experiments] end get do experiments = [] diff --git a/ee/lib/ee/api/entities/experiment.rb b/ee/lib/ee/api/entities/experiment.rb index dc1d53676f5a00ef7d33a2a845ccf202a3986a0a..bfa69bd5085d3f98926215f756d823c47ee4f0c8 100644 --- a/ee/lib/ee/api/entities/experiment.rb +++ b/ee/lib/ee/api/entities/experiment.rb @@ -4,7 +4,7 @@ module EE module API module Entities class Experiment < Grape::Entity - expose :key do |definition| + expose :key, documentation: { type: 'string', example: 'code_quality_walkthrough' } do |definition| definition.attributes[:name].gsub(/_experiment_percentage$/, '') end