Commit db126c49 authored by Gabriel Mazetto's avatar Gabriel Mazetto

Merge branch 'dz-change-api-content-type' into 'master'

Change api content type to json

See merge request gitlab-org/gitlab!42229
parents eeebd469 f5b92f55
---
name: api_json_content_type
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/42229
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/270067
group: group::ecosystem
type: development
default_enabled: false
......@@ -115,7 +115,14 @@ module API
format :json
formatter :json, Gitlab::Json::GrapeFormatter
content_type :txt, "text/plain"
# There is a small chance some users depend on the old behavior.
# We this change under a feature flag to see if affects GitLab.com users.
if Feature.enabled?(:api_json_content_type)
content_type :json, 'application/json'
else
content_type :txt, 'text/plain'
end
# Ensure the namespace is right, otherwise we might load Grape::API::Helpers
helpers ::API::Helpers
......
......@@ -5,6 +5,8 @@ module API
class Runner < ::API::Base
helpers ::API::Helpers::Runner
content_type :txt, 'text/plain'
resource :runners do
desc 'Registers a new Runner' do
success Entities::RunnerRegistrationDetails
......
......@@ -9,6 +9,8 @@ module API
MODULE_VERSION_REQUIREMENTS = { module_version: MODULE_VERSION_REGEX }.freeze
content_type :txt, 'text/plain'
before { require_packages_enabled! }
helpers do
......
......@@ -6,6 +6,8 @@ module API
class Repositories < ::API::Base
include PaginationParams
content_type :txt, 'text/plain'
helpers ::API::Helpers::HeadersHelpers
before { authorize! :download_code, user_project }
......
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