Open gauravs456 opened 1 week ago
Hi Folks, I am facing the issue while converting the xml to json XML I have
`
<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>
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
{ "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" } }
What is the issue you're facing?
It is merging the same key in single error i want seperate object how can i achieve this
Hi Folks, I am facing the issue while converting the xml to json
XML I have
`
`
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