Details
Description
the [jslt-action] kamelet, based on the JSLT component is very handy for performing data transformations with JSON input.
However, when configuring KameletBindings, for non-Camel users, it becomes tricky as some Kamelet sources deliver JSON in byte[]. If we bind for example a Telegram Source with the JSLT action before sending it to some backend, the process fails with the following message:
org.apache.camel.ValidationException: Allowed body types are String or InputStream.. Exchange[]
One way to work around the problem is to customise the JSLT-action to convert the body to String, or modify the Telegram source to deliver String JSON payloads.
Attached is a sample project containing a modified JSLT-action and a sample KameletBinding connecting Telegram to the JSLT action. Note the modified action converts the body to String.