Fix xml to json converter
authorEduardo Ramos Testillano (ert) <eduardo.ramos.testillano@gmail.com>
Mon, 1 Nov 2021 12:56:53 +0000 (13:56 +0100)
committerEduardo Ramos Testillano (ert) <eduardo.ramos.testillano@gmail.com>
Mon, 1 Nov 2021 12:56:53 +0000 (13:56 +0100)
commit1b744dbd580cc353d18b119eef361abe1850a91b
tree9119d3f5b25e436e07f713c84b0a57c101b36b16
parent609c79ead77490f99f3f34836b19820999a85169
Fix xml to json converter

When an array has a unique element, xmltodict does not
parse it as an array, but a single object. This causes
a problem in the diameter xml conversion because the
library for reverse conversion [0] won't follow the
diameter message dtd template.

Fortunately, xmltodict supports [1] force array for specific
node name, so we will force this for 'avp' which is the
one affected.

[0] https://github.com/testillano/json2xml
[1] https://stackoverflow.com/questions/37207353/xmltodict-does-not-return-a-list-for-one-element
example/diameter/launcher/resources/rest_api/helpers/diameterJsonHelper/xml2json.py