You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd recommend building two separate xml2js parser files for API calls, as it's the solution which always works.
As of recent, you can nest multiple (2) objects in the parser without calling reset. This does require prior CDATA recognising $root as the primary object and changing the default settings, see docs from "mergeargs" to "async".
If you haven't fixed it yet, what's the full code you've inputted? As this is a linter issue, I also recommend looking into the eyes bug catcher
Hi Folks,
I am facing the issue while converting the xml to json
XML I have
<Response> <Audio>https://example.com/audio-files/12345/random-audio.mp3</Audio> <Connect trunk="Opensips-Incoming-ABC_1234567890" callerId="1234567890" webhookUrl="https://webhook.site/abcdefg-hijklmnop-qrstuv-wxyz" webhookMethod="POST" terminateOnHangup="true">+1234567890</Connect> <Audio>https://example.com/audio-files/67890/another-random-audio.mp3</Audio> </Response>
The output I am receiving is
{ "Response": { "Audio": [ "https://example.com/audio-files/12345/random-audio.mp3", "https://example.com/audio-files/67890/another-random-audio.mp3" ], "Connect": { "trunk": "Opensips-Incoming-ABC_1234567890", "callerId": "1234567890", "webhookUrl": "https://webhook.site/abcdefg-hijklmnop-qrstuv-wxyz", "webhookMethod": "POST", "terminateOnHangup": "true", "number": "+1234567890" } } }
and the Output I want in json is like
{ "Response": { "Audio": "https://example.com/audio-files/12345/random-audio.mp3", "Connect": { "trunk": "Opensips-Incoming-ABC_1234567890", "callerId": "1234567890", "webhookUrl": "https://webhook.site/abcdefg-hijklmnop-qrstuv-wxyz", "webhookMethod": "POST", "terminateOnHangup": "true", "number": "+1234567890" }, "Audio": "https://example.com/audio-files/67890/another-random-audio.mp3" } }
how can i acheive this using the library
The text was updated successfully, but these errors were encountered: