postman-app-support icon indicating copy to clipboard operation
postman-app-support copied to clipboard

Postman Flows: XML to JSON conversion removes special key (example '$')

Open martinezq opened this issue 1 year ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the tracker for existing similar issues and I know that duplicates will be closed

Describe the Issue

Postman Flows seem to use XML to JSON converter similar to the one used in Postman Test scripts. In Posman.

Example from request test script:

var jsonObject = xml2Json('<resource id="123"><attributes><attribute name="hello" value="world" /></attributes></resource>');

console.log(JSON.stringify(jsonObject, null, 2));

prints

{
  "resource": {
    "$": {
      "id": "123"
    },
    "attributes": {
      "attribute": {
        "$": {
          "name": "hello",
          "value": "world"
        }
      }
    }
  }
}

If the same XML was returned by API, in the Flow all the '$' are missing, so the content is useless.

Could you please make sure the full XML2JSON conversion is supported in Flows?

Steps To Reproduce

Please check the description

Screenshots or Videos

No response

Operating System

Windows

Postman Version

10.24.2

Postman Platform

Postman App

User Account Type

Signed In User

Additional Context?

No response

martinezq avatar Mar 15 '24 19:03 martinezq