API properties

Properties are used by the gateway to control behavior of certain policies. Typically, you provide properties, but the policy can also provide properties settings.

In IBM® API Connect, you can create API properties that consist of Catalog-specific values to eliminate the need for source code modifications. You can then reference the properties elsewhere in your API definition.

Pre-supplied API properties

Pre-supplied API properties for various policies are shown in the tables.

A list of invoke related API properties that control the behavior of the invoke policy.
Table 1. Properties controlling the invoke policy
Property Required Description Data type
DataPower Gateway (Classic)
onlyx-ibm-gateway-decode-request-params No If set to a value of true, any request parameters that are referenced by a variable definition on an invoke target-url are URL-decoded. The default behavior is to not decode any parameters, thereby sending them to the target URL without alteration. Boolean
DataPower Gateway (Classic)
onlyx-ibm-gateway-invoke-suppress-clientid No When set with a value of true, or not specified, the X-IBM-Client-Id HTTP header (if specified on the API request) is suppressed from being sent to the invoke target URL. When set with a value of false, the X-IBM-Client-Id HTTP header is no longer suppressed from being sent to the invoke target URL.

This property is supported only by the DataPower® Gateway (v5 compatible). If you are using the DataPower API Gateway then to achieve the same functionality add a header-control property to the invoke policy configuration in the OpenAPI definition for your API, as in the following examples.

Suppress the X-Client-ID header as follows:
- invoke:
    target-url: http://myhostname/mypath
    header-control:
        type: blacklist
        values:
            - ^X-Client-ID$
Suppress the userId query parameter as follows:
- invoke:
    target-url: http://myhostname/mypath
    parameter-control:
        type: blacklist
        values:
            - ^userId$
Boolean
DataPower Gateway (Classic)
onlyx-ibm-gateway-optimize-invoke No If set to false, prevents the replacement of the last invoke in a policy with proxy. Any value other than false (case insensitive) will result in the last invoke in a policy possibly being replaced by proxy when the API is executed in the gateway. Boolean
DataPower Gateway (Classic)
onlyx-ibm-gateway-queryparam-encode-plus-char No If set to a value of true, all + characters in the query parameter values of the target-url of the Invoke and Proxy policies are encoded to %2F.

The default value is false.

Boolean
DataPower Gateway (Classic)
onlyx-ibm-gateway-api-enforce-response-limits No If set to a value of true, allows the JSON parser to be enforced on the response rule. If the response body size is higher than the JSON parser limit set in the DataPower domain, a status code of 500 is returned.
Note: The x-ibm-gateway-api-enforce-response-limits property is supported by the DataPower Gateway (v5 compatible) but not by the DataPower API Gateway. However, if you are using the DataPower API Gateway, consider using a Parse policy in your API assembly to enforce these limits.

For information on the different types of gateway, see API Connect gateway types.

Boolean
DataPower Gateway (Classic)
onlyx-ibm-gateway-invoke-emulate-v4-soap-error No IBM API Management Version 4.0 initiates a DataPower error when a SOAP fault is returned from a web service. IBM API Connect provides a mechanism to catch SOAP errors and does not initiate a DataPower error. For compatibility with APIs developed in IBM API Management Version 4.0, set this property to true only in the case where a gateway extension is expecting to handle a SOAP error in a post error rule.

The default value is false.

Note: This property is deprecated in favor of x-ibm-gateway-invoke-emulate-v4-invoke-error.
Boolean
DataPower Gateway (Classic)
onlyx-ibm-gateway-invoke-keep-payload No If set to a value of true, the invoke policy sends a payload on an HTTP DELETE method. This property is available for use with IBM DataPower Gateway version 7.7.1.1 and later.

The default value is false.

Boolean
DataPower Gateway (Classic)
onlyx-ibm-gateway-invoke-emulate-v4-invoke-error No IBM API Management Version 4.0 initiates a DataPower error when a backend server error is returned, either a SOAP fault returned from a web service or a JSON or XML (non-SOAP) error from a restful service. IBM API Connect provides a mechanism to catch SOAP errors and operation errors and does not initiate a DataPower error when they occur. If no catch policy is configured, a generic error message is generated. For compatibility with APIs developed in IBM API Management Version 4.0, set this property to true only in the case where a gateway extension is expecting to handle a backend server error in a gateway extension post error rule or if the client of the API is expecting the backend server error to be returned.

The default value is false.

Boolean
A list of map-related API properties that control the behavior of the map policy.
Table 2. Properties controlling the map policy
Property Required Description Data type
DataPower Gateway (Classic)
onlyx-ibm-gateway-map-array-first-element-value No In IBM API Management Version 4.0, if a mapping source value is from an array then only the first value is output. In API Connect, the default behavior is to return an array of all array element values. To maintain compatibility with IBM API Management Version 4.0, set this API property to true to only return the first array element value. Boolean
DataPower Gateway (Classic)
onlyx-ibm-gateway-map-resolve-apic-variables No By default, any API Connect variable that is found in the map configuration is resolved. For example, $(request.headers.content-type) resolves to the request's content type header. Because searching for variables in every map property can be CPU intensive, you can choose not to resolve variables by setting this API property to false. If this property is not configured or is set to any other value, the existing behavior to search for these variables continues. Note that variable usage within a map value JavaScript snippet is not changed provided that the variables that are referenced come from a configured map input. Boolean
DataPower Gateway (Classic)
onlyx-ibm-gateway-map-create-empty-array No This property controls how the map policy handles the output of an empty array; it can have the following values:
  • all: Output all empty arrays, including empty children arrays. This is the default value if the property is not configured or has an invalid value.
  • parent: Output only the current property's empty array value. Children map actions of this property are not attempted.
  • none: Prevent any empty output array values from being produced.
String
DataPower Gateway (Classic)
onlyx-ibm-gateway-optimize-schema-definition No Set the value of this property to true to provide a performance improvement to the map policy when a very complex schema definition is referenced by a policy output definition; for example, some very complex schemas that are generated by importing a very complex WSDL schema.

The map policy builds a schema from an API definition when a referenced definition is provided as the value of the schema. If the schema does not have references that generate a circular reference, setting this property to true might provide a performance benefit while generating the same schema as would otherwise have been generated. However, in cases where the schema is very complex, with many potentially circular references, the generated schema could be different because the enhanced schema handling processes circular references differently. In such cases therefore, you should examine the resulting output to determine if the performance benefit gained is not at the expense of a change in the map policy output.

The default value of this property, is false, maintaining the existing behavior and performance.

Boolean
DataPower Gateway (Classic)
onlyx-ibm-gateway-map-null-value No Set the value of this API property to true to allow a property from a map policy's input data with a value of null to be mapped to the output document. By default, a property from a map policy's input data with a value of null is not mapped to the output document. Boolean
DataPower Gateway (Classic)
onlyx-ibm-gateway-map-resolve-xmlinput-datatypes No XML input elements with numeric or boolean data have no metadata to indicate whether this data should be mapped as a string value or as the specific data type. If you set the value of this property to false, XML input elements are always mapped as a string. If you set the value to true, numeric or boolean XML input elements are mapped as the corresponding data type from the input schema.

The default value is false.

Boolean
DataPower Gateway (Classic)
onlyx-ibm-gateway-map-xml-empty-element No This property controls how the map policy handles XML input empty elements and impacts JSON output when the input document is XML; it can have the following values:
  • string: The value for an empty XML element is considered to be an empty string. This is the default value if the property is not configured or has an invalid value.
  • null: The value for an empty XML element is considered to be null. A mapping of this element to a JSON output property does not occur unless the API property x-ibm-gateway-map-null-value is also specified with a value of true.
  • none: The empty XML element is ignored.
  • string-badgerfish: The value for an empty XML element is considered to be an empty string. The empty string value will be placed into a JSON badgerfish value property.
  • null-badgerfish: The value for an empty XML element is considered to be null. The null value will be placed into a JSON badgerfish value property. A mapping of this element to a JSON output property does not occur unless the API property x-ibm-gateway-map-null-value is also specified with a value of true.
Boolean
DataPower Gateway (Classic)
onlyx-ibm-gateway-schema-definition-reference-limit No Set the value of this property to an integer value that specifies the maximum allowed number of iterations of a circular schema definition.

The default value is 1, which means that circular schema definitions are not followed. The maximum possible value is 5. If you specify a value greater than 5, a value of 5 is assumed. If you specify a non-numeric value, a value of 1 is assumed.

String
DataPower Gateway (Classic)
onlyx-ibm-gateway-map-emulate-v4-default-required-properties No Set this property to true to have default values generated in the output for required properties that are either not mapped, or for which there is no input data present, in the following specific cases:
  • An array consists of objects that contain one or more required properties.
  • An object which is optional has one or more child properties that are required.

By default, these required properties are not present in the output. If you set the x-ibm-gateway-map-emulate-v4-default-required-properties API property to true, these required properties will be present in the output. If the output schema defines a default property for the output property then the specified default value is used, otherwise a default value is assigned dependent on the data type, as follows:

  • String: empty string ("")
  • Number: 0
  • Boolean: false
  • Object: empty object
  • Array: empty array
Example 1
The input data has the following array of objects:
[{“a”: “value1”}, {“a”: “value2", "b": “value3”}]

The output schema defines the output object as having two properties, a and b, of which b is required. The map policy defines the following mappings:

  • input.array.a to output.array.a
  • input.array.b to output.array.b

If the x-ibm-gateway-map-emulate-v4-default-required-properties API property is set to true, and b is either not mapped or has no input data present, then b is assigned a default value of an empty string, and the output is as follows:

[{“a”: “value1", "b": ""}, {"a": "value2", "b": "value3"}]
Example 2
The output schema defines the following structure:
{"a" : {"b" : {"c" : "value1", "d" : "value2"} } }

Property b is optional but property d within b is required.

The map policy defines a mapping to output.a.b.c.

If the x-ibm-gateway-map-emulate-v4-default-required-properties API property is set to true, and d is not mapped, then d is assigned a default value of an empty string, and the output is as follows:

{"a" : {"b" : {"c" : "value1", "d" : ""} } }

If the x-ibm-gateway-map-emulate-v4-default-required-properties API property is not specified or does not have a value of true, these required properties are not created in the output with their default values.

Boolean
DataPower Gateway (Classic)
onlyx-ibm-gateway-map-post-process-json-output No Set the value of this property to true to enable post processing of mapped JSON output. The post processing of JSON output will use the output schema to ensure that property values are of the same data type as that defined in the schema. It will also normalize output property values that have a Badgerfish JSON syntax due to object mapping of an XML input. Set the value to false for no post processing of mapped JSON output.

The default value is false.

Boolean
DataPower Gateway (Classic)
onlyx-ibm-gateway-map-emulate-v4-empty-json-object No If a mapping fails because its input is not present and there is no default mapping configured, the default behavior is to not to make any change to the output mapping. Set the value of this property to true to create an empty object for the parent of the target mapping, emulating the behavior of IBM API Management Version 4.0.
Example
The map policy defines a mapping to output.a.b.c.
If input data is present, the output is as follows:
{
  "a": {
    "b": {
      "c": "inputvalue"
    }
  }
}
If there is no input data, and the x-ibm-gateway-map-emulate-v4-empty-json-object API property is set to true, the output is as follows:
{
  "a": {
    "b": {
    }
  }
}
Properties a and b are created but the value of b is an empty object.

The default value is false.

Boolean
DataPower Gateway (Classic)
onlyA list of proxy-related API properties that control the behavior of the proxy policy.
Table 3. Properties controlling the proxy policy
Property Required Description Data type
x-ibm-gateway-proxy-suppress-clientid No A setting of false activates the injection of the X-IBM-Client-Id HTTP header (if it is specified on the API request), or the client_id query parameter in the request URL, to the proxy target-url. If not specified, or set with a value of true, suppresses the sending of this parameter to the proxy target-url.

This property is supported only by the DataPower Gateway (v5 compatible). If you are using the DataPower API Gateway then to achieve the same functionality add a header-control property to the invoke policy configuration in the OpenAPI definition for your API, as in the following examples.

Suppress the X-Client-ID header as follows:
- proxy:
    target-url: http://myhostname/mypath
    header-control:
        type: blacklist
        values:
            - ^X-Client-ID$
Suppress the userId query parameter as follows:
- proxy:
    target-url: http://myhostname/mypath
    parameter-control:
        type: blacklist
        values:
            - ^userId$
Boolean
x-ibm-gateway-optimize-invoke No If set to false, prevents the replacement of the last invoke in a policy with proxy. Any value other than false (case insensitive) will result in the last invoke in a policy possibly being replaced by proxy when the API is executed in the gateway. Boolean
x-ibm-gateway-queryparam-encode-plus-char No If set to a value of true, all + characters in the query parameter values of the target-url of Invoke and Proxy policies are encoded to %2F.

The default value is false.

Boolean
x-ibm-gateway-api-enforce-response-limits No If set to a value of true, allows the JSON parser to be enforced on the response rule. If the response body size is higher than the JSON parser limit set in the DataPower domain, a status code of 500 is returned. Boolean
A list of API properties that control the behavior of the rate limit policy.
Table 4. Properties controlling the rate limit policy
Property Required Description Data type
x-ibm-gateway-emulate-v4-plan-rate-limit No By default in IBM API Connect Version 10, if you configure a rate limit only for a Plan and not for the API operations within the Plan then a single rate limit threshold is set for the API as a whole, regardless of which operation in the API is requested. This behavior differs from IBM API Management Version 4.0 where the rate limit is set individually for each operation in the API. To change the Version 10 behavior to emulate the Version 4.0 behavior, set this API property to a value of true. Boolean
A list of API properties that control the behavior of multiple policies.
Table 5. Properties controlling multiple policies
Property Required Description Data type
DataPower Gateway (Classic)
onlyx-ibm-gateway-sourcecode-resolve-apic-variables No If set to true, API Connect variable references are resolved. Set to false if you want the policy to ignore API Connect variable references.

The default value is true.

This property applies to the following policies:
  • Map
  • GatewayScript
  • XSLT
  • if
  • switch
Note: This property setting is overridden by the x-ibm-gateway-map-resolve-apic-variables API property setting for the Map policy.
Boolean
DataPower Gateway (Classic)
onlyx-ibm-gateway-api-json-parse-error-handling No If an API request or response payload includes valid JSON content that contains characters that cannot be represented in the JSONX XML internal syntax that is used by the DataPower Gateway, set this property to escape-unicode to allow the payload to be accepted without parsing errors. If this property is not configured or is set to any other value, the payload is rejected as invalid JSON.

This property applies to the API request payload, and to the API response payload when x-ibm-gateway-api-enforce-response-limits is enabled.

String
DataPower Gateway (Classic)
onlyx-ibm-gateway-framework-preserve-escaped-reverse-solidus No By default, the string \\ in a policy property is converted to a single \ character. Set this property to true to preserve the string \\. Boolean
DataPower Gateway (Classic)
onlyx-ibm-gateway-inspect-request-headers No Causes an inspection of the HTTP headers in the API request to check for characters in the header values that are illegal XML characters; it can have the following values:
  • default: There is no inspection for these characters in the header values. If one is present, the API request fails with an HTTP 500 Internal Server Error.
  • sanitize: Any illegal XML characters in header values are replaced with a ? character. The API processing will continue. Any API that attempts to read request.headers.<headername> will see the ? character in the value. However, the original protocol headers representing message.headers will still have the original character, which will be sent to an invoke or proxy backend server.
  • bad-request: There will be an inspection for these characters in the header values. If one is present, the API request fails with an HTTP 400 Bad Request.

The default value is default.

Boolean