Wrangle XML to Json parser incorrectly converts string value

Description

  1. upload an xml

2. parse xml to json

As you can see, the value gets converted.

Release Notes

None

Attachments

2
  • 05 Jan 2024, 10:21 PM
  • 05 Jan 2024, 10:21 PM

Activity

Show:

Sanket SahuJanuary 23, 2024 at 10:53 AM

 

Ankit JainJanuary 18, 2024 at 5:46 PM

According to , option 2 is preferred.

Sanket SahuJanuary 18, 2024 at 5:45 PM

RCA :

In parse-xml-to-json code , we use industry standard XML and gson libraries where we convert using

XML.toJSONObject(string)

By default , This internally it tries to convert XML string values into a JSON value. by code logic : it tried to convert to boolean, int, long etc... if it fails then reverts to string.

But there is another config XML.toJSONObject(String string, boolean keepStrings) , where keeping keepStrings = true gives correct result.

We can implement :

parse-xml-to-json :[value] [depth] [keepStrings]

Where keepStrings would be optional and default can be set to TRUE


For both cases implementation SWE estimate would be 2-3 days
and then we can release that directive via HUB

So overall 3-4 days.

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Affects versions

Triaged

No

Components

Fix versions

Priority

Created January 5, 2024 at 10:21 PM
Updated February 7, 2024 at 6:03 PM
Resolved February 7, 2024 at 6:03 PM