Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Generate Collection" produces incorrect XML requests and responses from Open API 3.0 and Swagger 2.0 API definitions #11227

Closed
1 task done
DeviousBard opened this issue Aug 31, 2022 · 2 comments

Comments

@DeviousBard
Copy link

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:

  1. 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 ""
  2. 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>")
  3. 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

  1. Import the "example-swagger.json" file as a new API definition.
  2. Click the "Generate Collection" button from the API "Definition" tab.
  3. 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

@DannyDainton DannyDainton added bug collection-schema All issues related to the collection schema definitions. product/api-platform labels Sep 2, 2022
@VShingala VShingala added product/api-design and removed product/api-platform collection-schema All issues related to the collection schema definitions. labels Dec 12, 2022
@agentmil1
Copy link

I experienced the same issue with closing tags missing the namespace prefix. Also, I noticed that Postman doesn’t put prefixes on Arrays (both, opening and closing XML tags).

@VShingala
Copy link
Member

@DeviousBard @agentmil1 We've fixed this issue! Do try it out and let us know if you face any further issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants