postmanlabs / postman-app-support

Postman is an API platform for building and using APIs. Postman simplifies each step of the API lifecycle and streamlines collaboration so you can create better APIs—faster.
https://www.postman.com
5.82k stars 839 forks source link

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

Open martinezq opened 6 months ago

martinezq commented 6 months ago

Is there an existing issue for this?

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

pbalsara-wk commented 2 months ago

I'm also running into this issue. When attempting to get an XML attribute, I get nothing in the Output. It does not show attributes as available information.