Hi Jyoti,
The newline character (hex 0D) needs to be replaced with the characters \n. In GatewayScript, use
let jsonValueString = JSON.stringify(textValueString);
which should do the escaping for you.
Regards,
Steve
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM
------------------------------
Original Message:
Sent: Thu May 05, 2022 02:15 AM
From: Jyoti Yadav
Subject: Need Multiline text into single line JSON format
Hello Team,
We need to convert multiline plaintext data to singleline JSON format to parse data in IBM API connect v10.
We are getting multiline JSON format data which are getting error while parsing.
Please find below scenario.
Eg:
Plaintext:
xyz{"ww
yy"}
JSON :
xyz{"WW YY"}
------------------------------
Jyoti Yadav
------------------------------