You are browsing documentation for an outdated plugin version.
Configuration
This plugin is compatible with DB-less mode.
Parameters
Here's a list of all the parameters which can be used in this plugin's configuration:
-
name or plugin
string requiredThe name of the plugin, in this case
response-transformer-advanced
.- If using the Kong Admin API, Konnect API, declarative configuration, or decK files, the field is
name
. - If using the KongPlugin object in Kubernetes, the field is
plugin
.
- If using the Kong Admin API, Konnect API, declarative configuration, or decK files, the field is
-
service.name or service.id
stringThe name or ID of the service the plugin targets. Set one of these parameters if adding the plugin to a service through the top-level
/plugins
endpoint. Not required if using/services/{serviceName|Id}/plugins
. -
route.name or route.id
stringThe name or ID of the route the plugin targets. Set one of these parameters if adding the plugin to a route through the top-level
/plugins
endpoint. Not required if using/routes/{routeName|Id}/plugins
. -
consumer.name or consumer.id
stringThe name or ID of the consumer the plugin targets. Set one of these parameters if adding the plugin to a consumer through the top-level
/plugins
endpoint. Not required if using/consumers/{consumerName|Id}/plugins
. -
enabled
boolean default:true
Whether this plugin will be applied.
-
config
record required-
remove
record required-
json
array of typestring
List of property names. Remove the property from the JSON body if it is present.
-
headers
array of typestring
List of
headername[:value]
. If onlyheadername
is given, unset the header field with the givenheadername
. Ifheadername:value
is given, unset the header fieldheadername
when it has a specificvalue
. Ifvalue
starts and ends with a/
(slash character), then it is considered to be a regular expression. Note that in accordance with RFC 7230 multiple header values with the same header name are allowed if the entire field value for that header field is defined as a comma-separated list or the header field is aSet-Cookie
header field.
-
if_status
array of typestring
List of response status codes or status code ranges to which the transformation will apply. Empty means all response codes.
-
-
rename
record required-
headers
array of typestring
List of
headername1:headername2
pairs. If a header withheadername1
exists andheadername2
is valid, rename header toheadername2
.
-
if_status
array of typestring
List of response status codes or status code ranges to which the transformation will apply. Empty means all response codes.
-
-
replace
record required-
body
stringString with which to replace the entire response body.
-
json
array of typestring
List of property
name:value
pairs. If and only if the parameter is already present, replace its old value with the new one. Ignored if the parameter is not already present.
-
json_types
array of typestring
Must be one of:boolean
,number
,string
List of JSON type names. Specify the types of the JSON values returned when replacing JSON properties.
-
headers
array of typestring
List of
headername:value
pairs. If and only if the header is already set, replace its old value with the new one. Ignored if the header is not already set.
-
if_status
array of typestring
List of response status codes or status code ranges to which the transformation will apply. Empty means all response codes.
-
-
add
record required-
json
array of typestring
List of
name:value
pairs. If and only if the property is not present, add a new property with the given value to the JSON body. Ignored if the property is already present.
-
json_types
array of typestring
Must be one of:boolean
,number
,string
List of JSON type names. Specify the types of the JSON values returned when adding a new JSON property.
-
headers
array of typestring
List of
headername:value
pairs. If and only if the header is not already set, set a new header with the given value. Ignored if the header is already set.
-
if_status
array of typestring
List of response status codes or status code ranges to which the transformation will apply. Empty means all response codes.
-
-
append
record required-
json
array of typestring
List of
name:value
pairs. If the property is not present in the JSON body, add it with the given value. If it is already present, the two values (old and new) will be aggregated in an array.
-
json_types
array of typestring
Must be one of:boolean
,number
,string
List of JSON type names. Specify the types of the JSON values returned when appending JSON properties.
-
headers
array of typestring
List of
headername:value
pairs. If the header is not set, set it with the given value. If it is already set, a new header with the same name and the new value will be set.
-
if_status
array of typestring
List of response status codes or status code ranges to which the transformation will apply. Empty means all response codes.
-
-
allow
record required-
json
set of typestring
Set of parameter names. Only allowed parameters are present in the JSON response body.
-
-
transform
record required-
functions
array of typestring
Set of Lua functions to perform arbitrary transforms in a response JSON body.
-
if_status
array of typestring
List of response status codes or ranges to which the arbitrary transformation applies. Leaving empty implies that the transformations apply to all response codes.
-
json
array of typestring
Apply Lua functions to a particular list of JSON property
name
orname:value
pairs.
-
-
dots_in_keys
boolean default:true
Whether dots (for example,
customers.info.phone
) should be treated as part of a property name or used to descend into nested JSON objects. See Arrays and nested objects.
-