"Generate Collection" produces incorrect XML requests and responses from Open API 3.0 and Swagger 2.0 API definitions #11227
Closed
Description
Is there an existing issue for this?
- I have searched the tracker for existing similar issues and I know that duplicates will be closed
Describe the Issue
For Open API 3.0 and Swagger 2.0 REST API definitions that consume and produce XML documents, the "Generate Collection" button does not build valid requests and responses for the XML in the newly created "Collection". Errors in the generated XML are as follows:
- The generator assumes the "prefix" property is included in the "xml" object definition, even when it's not. If the "prefix" is excluded for a "namespace" the namespace attribute gets generated as " (with the extra colon after "xmlns") instead of ""
- If the "prefix" is included, the generator puts the "prefix" on the starting element (i.e. "myprefix:MyElement), but does not include the prefix on the corresponding ending element (i.e. It produces "" instead of "</myprefix:MyElement>")
- The generator does not produce the XML element tags for properties with "boolean" types. Instead, it just prints "undefined" where those elements should have been included.
The attached files show an example Open API 3.0 document and the request and response XML that was generated.
example-response-body.xml.txt
example-request-body.xml.txt
example-swagger.json.txt
Steps To Reproduce
- Import the "example-swagger.json" file as a new API definition.
- Click the "Generate Collection" button from the API "Definition" tab.
- Observe the new "Collection" that was created and see the errors that are detailed in the description of this bug report in the "Body" tab of the request and the "Body" tab of the response.
Screenshots or Videos
No response
Operating System
Windows
Postman Version
9.30.1
Postman Platform
Postman App
Additional Context?
No response