Commit e76567e8 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch 'default-enabled-api_always_use_application_json' into 'master'

Feature flag: Default API content type JSON

See merge request gitlab-org/gitlab!54479
parents 66fb025c 8e3c7c03
---
title: Change default API content_type to JSON
merge_request: 54479
author:
type: changed
...@@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/270067 ...@@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/270067
milestone: '13.6' milestone: '13.6'
type: development type: development
group: group::ecosystem group: group::ecosystem
default_enabled: false default_enabled: true
...@@ -750,7 +750,7 @@ specifically used by GitLab.com, see ...@@ -750,7 +750,7 @@ specifically used by GitLab.com, see
The GitLab API supports the `application/json` content type by default, though The GitLab API supports the `application/json` content type by default, though
some API endpoints also support `text/plain`. some API endpoints also support `text/plain`.
In [GitLab 13.9 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/250342), In [GitLab 13.10 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/250342),
API endpoints do not support `text/plain` by default, unless it's explicitly documented. API endpoints do not support `text/plain` by default, unless it's explicitly documented.
This change is deployed behind the `:api_always_use_application_json` [feature flag](../user/feature_flags.md), This change is deployed behind the `:api_always_use_application_json` [feature flag](../user/feature_flags.md),
......
...@@ -147,7 +147,7 @@ module API ...@@ -147,7 +147,7 @@ module API
# Only overwrite `text/plain+deprecated` # Only overwrite `text/plain+deprecated`
if content_types[api_format] == 'text/plain+deprecated' if content_types[api_format] == 'text/plain+deprecated'
if Feature.enabled?(:api_always_use_application_json) if Feature.enabled?(:api_always_use_application_json, default_enabled: :yaml)
content_type 'application/json' content_type 'application/json'
else else
content_type 'text/plain' content_type 'text/plain'
......
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