Reading JSON in EDS via jsonToXML has incorrect results.

Solution Verified - Updated -

Issue

  • jsonToXML is not returning the correct XML data
    • query
select
convert
(
   jsonToXml ( 'person', convert ( '[
                 {
                    "key": "ncloc",
                    "val": 229355,
                    "frmt_val": "229,355"
                 },
                 {
                    "key": "sqale_index",
                    "val": 8480.74957,
                    "frmt_val": "8,480.7"
                 }
        ]',clob ) ),
   string
);
  • expected
<?xml version='1.0' encoding='UTF-8'?>
<person>
 <person>
  <key>ncloc</key>
  <val>229355</val>
  <frmt_val>229,355</frmt_val>
 </person>
 <person>
   <key>sqale_index</key>
   <val>8480.74957</val>
   <frmt_val>8,480.7</frmt_val>
  </person>
</person>
  • returned
<?xml version='1.0' encoding='UTF-8'?>
<person>
 <person>
  <key>ncloc</key>
  <val>229355</val>
  <frmt_val>229,355</frmt_val>
 </person>
 <frmt_val>
  <key>sqale_index</key>
  <val>8480.74957</val>
  <frmt_val>8,480.7</frmt_val>
 </frmt_val>
</person>
  • JSONTOXML is not transforming correctly when JSON response include arrays with children list as param:value.

Environment

  • Red Hat JBoss Enterprise Data Services (EDS) 5.3.1

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content