Trim extra spaces in Array or Object or any type of payload using Dataweave in Mule 4

Ravi Teja Gajarla
1 min readMay 31, 2020

How to remove extra space in json array or object using dataweave in Mule 4.

The following dataweave code trims the content of any kind of payload whether it is Array or Object or String.

Find the datweave code below.

Suggestions or requests for dataweave logics or any PoC can be sent to raviteja.gajarla@gmail.com

--

--