Forum Discussion

rajrao's avatar
rajrao
Occasional Contributor
4 years ago
Solved

Multiline string in readable format for mediatype application/json

Hi,

 

Our Rest API request has json body and one of the values is a  multiline String(XML), when I paste the json body in readyapi request editor and send, I get errors if the whole string is not in single line, for readability purpose am wondering if there is a way I could have this string value(which is a 100 tags XML) on multiple lines rather than having it in one huge single line ? 

 

My JSON request example below and the key 'message' has a value in 'xml' format and type 'string'. I have only pasted few lines below but my xml string is more than 100 tags. All those 100 tags need to be in one line for the validation to be successful but that is making the string unreadable, so wondering if there is a way I can have each tag in a separate line so that the request can be easily readable.

{
"messageId": "123456",
"source": "messageReceiver",
"message": "<con:Control xmlns:con=\"http://www.gov.com/taxation/InternationalTrade/Common/ControlDocument\">
<con:MetaData>
<con:MessageId>00001733</con:MessageId>
<con:Source>ABC</con:Source>
</con:MetaData>
<con:OperationRequest>
<con:Parameters xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">
<con:Parameter Name=\"ExciseRegistrationNumber\">00467015</con:Parameter>
<con:Parameter Name=\"message\">
<![CDATA[<IA815 xmlns=\"urn:publicid:-:EC:DGTAXUD:PHASE4:IA815:V3.01\" xmlns:tms=\"urn:publicid:-:EC:DGTAXUD:PHASE4:TMS:V3.01\">
<Header>
<tms:MessageSender>NDA.AB</tms:MessageSender>
<tms:MessageIdentifier>902M57S53x1</tms:MessageIdentifier>
</Header>
<Body>
<SubmittedDraftOfEAD>
<Attributes>
<SubmissionMessageType>1</SubmissionMessageType>
<DeferredSubmissionFlag>0</DeferredSubmissionFlag>
</Attributes>
</SubmittedDraftOfEAD>
</Body>
</IA815>]]>
</con:Parameter>
</con:Parameters>
<con:ReturnData><con:Data Name=\"schema\"/></con:ReturnData>
</con:OperationRequest></con:Control>"
}