postmanlabs / openapi-to-postman

Plugin for converting OpenAPI 3.0 specs to the Postman Collection (v2) format
Apache License 2.0
930 stars 200 forks source link

Added support for generating body examples as XML if mentioned. #724

Closed VShingala closed 1 year ago

VShingala commented 1 year ago

Overview

This PR adds support for generating request and response body correctly for XML type of data from example if available. This change is done on both v1 and v2 interface with corresponding tests.

To support the JSON data to XML body conversion, we've used a stripped-down version of xml-js-graphite library to avoid extra dependencies. As this logic shouldn't need any updates in foreseeable future and logic being quite simple, having logic as separate file makes more sense.