---
title: c JOLT
description: Available connectors
documentId: ipaas-jolt
locale: en-US
---

The [**JOLT**](https://camel.apache.org/components/4.10.x/jolt-component.html) component allows you to transform and manipulate JSON data declaratively using specifications defined in JOLT files.

**URI Syntax**: `jolt:resourceUri`

## Main fields

*Path parameters*

| **Name** | **Description** | **Default** | **Type** |
|----------|------------------|------------|----------|
| `resourceUri` (producer)| (required) Path to the resource. You can prefix with: classpath, file, http, ref or bean.  | — | String |


*Query parameters*

| **Name** | **Description** | **Default** | **Type** |
|----------|------------------|------------|----------|
|`inputType`(producer)|Specifies whether the input is hydrated JSON or a JSON String.          | Hydrated | JoltInputOutputType |
|`outputType`(producer)|Specifies whether the output should be hydrated JSON or a JSON String. | Hydrated | JoltInputOutputType |
|`contentCache` (producer)| Defines whether to use resource content cache or not.             | true     | Boolean |

## Example

<Steps>
<Step>
The flow starts with a POST request.
</Step>
<Step>
The request body is logged.
</Step>
<Step>
The flow transforms the request body using a Jolt template located in the [`template.json`](#json-template) file.
   - The `inputType: JsonString` and `outputType: JsonString` parameters ensure that input and output are handled as JSON strings.
   - `contentCache: true` enables result caching.
</Step>
<Step>
Finally, the flow logs the transformation result.
</Step>
</Steps>


```yaml
- from:
  uri: "rest:post:/jolt-poc"
  steps:
    - log:
      message: "Got body: ${body}"
    - to:
      uri: "jolt:template.json"
      parameters:
        inputType: JsonString
        outputType: JsonString
        contentCache: true
    - log:
      message: "Result: ${body}"
```
![](https://creative-ball-51b3fc85c0.media.strapiapp.com/component_jolt_0e820604a8.png)

### JSON template

```yaml
template.json: |-
  [
    {
    "operation": "cardinality",
    "spec": {
      "body": {
      "Envelope": {
        "Body": {
        "Mensagem": {
          "PedidoExame": {
          "listaExame": {
            "Exame": "MANY"
          }
          }
        }
        }
      }
      }
    }
    },
    {
    "operation": "shift",
    "spec": {
      "body": {
      "Envelope": {
        "Body": {
        "Mensagem": {
          "PedidoExame": {
          "setorSolicitante": "&",
          "codigoMaterial": "&",
          "paciente": {
            "codigoPaciente": "&"
          },
          "listaExame": {
            "Exame": {
            "*": {
              "coleta": {
              "codigoMaterial": "codigoMaterial[#3].cod"
              },
              "codigoExame": "codigoExame[#2].cod",
              "codigoItemPedido": "codigoPedido[#2].codPed"
            }
            }
          }
          }
        }
        }
      }
      }
    }
    }
  ]
```

### Result

```yaml
{
    "setorSolicitante": 55,
    "codigoPaciente": 555555,
    "codigoMaterial": [
        {
            "cod": 5
        },
        {
            "cod": 55
        },
        {
            "cod": 5555
        }
    ],
    "codigoExame": [
        {
            "cod": 5555
        },
        {
            "cod": 5555
        },
        {
            "cod": 5555
        }
    ],
    "codigoPedido": [
        {
            "codPed": 555555
        },
        {
            "codPed": 555555
        },
        {
            "codPed": 555555
        }
    ]
}
```
