Commit 36317932 authored by James Fargher's avatar James Fargher

Merge branch 'remove-grape-gitlab-json-ff' into 'master'

Remove grape_gitlab_json feature flag

See merge request gitlab-org/gitlab!80604
parents 268f150d 60aaff3b
---
name: grape_gitlab_json
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/36472
rollout_issue_url:
milestone: '13.2'
type: development
group: group::source code
default_enabled: true
......@@ -180,9 +180,6 @@ module Gitlab
class GrapeFormatter
# Convert an object to JSON.
#
# This will default to the built-in Grape formatter if either :oj_json or :grape_gitlab_json
# flags are disabled.
#
# The `env` param is ignored because it's not needed in either our formatter or Grape's,
# but it is passed through for consistency.
#
......@@ -194,11 +191,7 @@ module Gitlab
def self.call(object, env = nil)
return object.to_s if object.is_a?(PrecompiledJson)
if Feature.enabled?(:grape_gitlab_json, default_enabled: true)
Gitlab::Json.dump(object)
else
Grape::Formatter::Json.call(object, env)
end
end
end
......
......@@ -317,11 +317,6 @@ RSpec.describe Gitlab::Json do
let(:env) { {} }
let(:result) { "{\"test\":true}" }
context "grape_gitlab_json flag is enabled" do
before do
stub_feature_flags(grape_gitlab_json: true)
end
it "generates JSON" do
expect(subject).to eq(result)
end
......@@ -331,23 +326,6 @@ RSpec.describe Gitlab::Json do
subject
end
end
context "grape_gitlab_json flag is disabled" do
before do
stub_feature_flags(grape_gitlab_json: false)
end
it "generates JSON" do
expect(subject).to eq(result)
end
it "uses Grape::Formatter::Json" do
expect(Grape::Formatter::Json).to receive(:call).with(obj, env)
subject
end
end
context "precompiled JSON" do
let(:obj) { Gitlab::Json::PrecompiledJson.new(result) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment