General Information
Policy Type
Description
JSON Transformation policy transforms JSON request/response bodies. It supports JSON-to-JSON transformation using JOLT specification and JSON-to-XML conversion with configurable options.Endpoints
List Policies
Add Policy
Update Policy
Delete Policy
List Policies
Endpoint
Request
Headers
| Header | Value |
|---|---|
| Authorization | Bearer {token} |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| apiProxyName | string | Yes | API Proxy name |
Response
Success Response (200 OK)
cURL Example
Add Policy
Endpoint
Request
Headers
| Header | Value |
|---|---|
| Authorization | Bearer {token} |
| Content-Type | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| apiProxyName | string | Yes | API Proxy name |
| policyName | string | Yes | Policy name |
Request Body
Full JSON Body Example - JSON to JSON Transformation
Full JSON Body Example - JSON to XML Transformation
Request Body Fields
operationMetadata
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| targetScope | string | Yes | - | Policy scope: ALL or ENDPOINT |
| targetEndpoint | string | No* | - | Endpoint path (required if targetScope=ENDPOINT) |
| targetEndpointHTTPMethod | string | No* | - | HTTP method (required if targetScope=ENDPOINT) |
| targetPipeline | string | Yes | - | Pipeline: REQUEST, RESPONSE, or ERROR |
| deploy | boolean | No | true | Whether to deploy after adding policy |
| deployTargetEnvironmentNameList | array | No | [] | List of environment names to deploy to |
| order | integer | No | null | Policy execution order (starts from 1) |
ALL- Policy applies to all endpointsENDPOINT- Policy applies only to specified endpoint
REQUEST- Executes in request pipeline (transforms request body)RESPONSE- Executes in response pipeline (transforms response body)ERROR- Executes in error pipeline
GET,POST,PUT,DELETE,PATCH,OPTIONS,HEAD
policy
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| type | string | Yes | - | Policy type: policy-json-transformation |
| description | string | No | - | Policy description |
| active | boolean | No | true | Whether policy is active |
| transformationType | string | Yes | JSON2JSON | Transformation type: JSON2JSON or JSON2XML |
| joltValue | string | No* | - | JOLT specification (required if transformationType=JSON2JSON) |
| jsonToXmlIgnoreNull | boolean | No | false | Ignore null values when converting to XML |
| jsonToXmlIgnoreEmpty | boolean | No | false | Ignore empty values when converting to XML |
| jsonToXmlUseNullForNil | boolean | No | false | Use null for nil attributes in XML |
| jsonToXmlUnwrapElement | boolean | No | false | Unwrap root element in XML output |
EnumJsonTransformationType
JSON2JSON- Transform JSON to JSON using JOLT specificationJSON2XML- Convert JSON to XML format
JOLT Specification
JOLT (JSON to JSON Transformation Language) is used for JSON-to-JSON transformations. It supports operations like:shift- Move/rename fieldsdefault- Set default valuesremove- Remove fieldssort- Sort arraysmodify- Modify valuescardinality- Handle array cardinality
JSON to XML Options
jsonToXmlIgnoreNull: Whentrue, null values are omitted from XMLjsonToXmlIgnoreEmpty: Whentrue, empty strings/arrays are omitted from XMLjsonToXmlUseNullForNil: Whentrue, usesxsi:nil="true"for null valuesjsonToXmlUnwrapElement: Whentrue, removes root wrapper element
Note
transformationTypeis required.- If
transformationType: JSON2JSON,joltValueis required. - JSON-to-XML options are only used when
transformationType: JSON2XML.
Response
Success Response (200 OK)
cURL Example
Update Policy
Endpoint
Request
Headers
| Header | Value |
|---|---|
| Authorization | Bearer {token} |
| Content-Type | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| apiProxyName | string | Yes | API Proxy name |
| policyName | string | Yes | Policy name |
Request Body
Full JSON Body Example
Response
Success Response (200 OK)
Delete Policy
Endpoint
Request
Headers
| Header | Value |
|---|---|
| Authorization | Bearer {token} |
| Content-Type | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| apiProxyName | string | Yes | API Proxy name |
| policyName | string | Yes | Policy name |
Request Body
Full JSON Body Example
Response
Success Response (200 OK)
Notes and Warnings
-
Transformation Type:
JSON2JSON- Uses JOLT specification for transformation (requiresjoltValue)JSON2XML- Converts JSON to XML format (uses JSON-to-XML options)
-
JOLT Specification:
- Must be valid JOLT JSON array
- Supports operations: shift, default, remove, sort, modify, cardinality
- See JOLT documentation for detailed syntax
-
JSON to XML Options:
jsonToXmlIgnoreNull: Omit null values from XML outputjsonToXmlIgnoreEmpty: Omit empty strings/arrays from XMLjsonToXmlUseNullForNil: Usexsi:nil="true"for null valuesjsonToXmlUnwrapElement: Remove root wrapper element
- Performance: JSON transformation adds processing overhead. Use for necessary transformations only.
-
Pipeline:
REQUESTpipeline transforms request body before forwardingRESPONSEpipeline transforms response body before sending to client
- Error Handling: Invalid JOLT specification or malformed JSON will cause transformation to fail
-
Deployment: Policy changes require deployment to take effect. Set
deploy: trueor deploy manually.
Related Documentation
- List Policies - List all policies
- Add Policy - General policy addition guide
- Update Policy - General policy update guide
- Delete Policy - General policy deletion guide
- XML Transformation Policy - Transform XML messages

