Skip to Content
0
Jan 09, 2023 at 06:17 AM

Java code to remove tag from source Json payload

291 Views

Hi All,

My requirement is to remove the result tag from the below input Json payload via java mapping.

Scenario is synchronous and have remove the result tag in the response flow. unfortunately there is no conversion (XML to JSON or vice versa) is used, so cannot use the existing channel option like strip outer element.

Input Json:-

{ "result": { "Country" :"", "City":"", "Address" : { "output" :[{ "Street":"", "Pin":"" }] } } }

Required Output :-

{ "Country" :"", "City":"", "Address" : { "output" :[{ "Street":"", "Pin":"" }] } }

Pls share Java code to achieve the required output

Thanks