The JSON (JavaScript Object Notation) format is one of the most widely used standards for data exchange between systems, especially in modern APIs and integrations. It allows structured information to be represented in a simple, readable way and is compatible with various programming languages.
In integration scenarios, it is common to transform JSON data into other formats, such as CSV, to facilitate consumption by spreadsheets or legacy systems. The example below shows how a flow can receive a JSON, process it, and generate a CSV file with the desired fields.
To process JSON data in integrations, we use specialized libraries that automate the conversion between JSON text and the system's internal structures. See the libraries available in Integrations:
TIPSWhen to choose another library?
Prefer Jackson (default) for most cases. Use Gson if you already use Google APIs, Fastjson for high performance, Johnzon or Jsonb for projects that follow Jakarta EE standards.Common error:
If the JSON is malformed or contains incompatible types, the conversion will fail. Always check the structure of the input data.
The flow below receives a POST request containing a JSON and returns a CSV file with the selected headers.
The flow starts with a POST request containing JSON data in the body.
Input (JSON):
The Unmarshal EIP converts the JSON to Camel's internal structure.
The Marshal EIP converts the internal structure to CSV (external format).
Uses a semicolon to separate values (delimiter: ";")
And adds the headers firstName and lastName.
Output (CSV):
We use cookies to enhance your experience on our site. By continuing to browse, you agree to our use of cookies.Learn more