I use Swagger in a Java app and have a collection that sets the parameters e.g. uuid, name on the corresponding POST requests. However,on every changes on database, the collections should be updated and I fed up with updating the Postman collections manually. I could not found a proper way except from some export approach e.g. Convert Swagger documentation to Postman Collection.
In this stage, I think I make something wrong and there is a better approach as lots of experienced developers use these tools :
1. How should I transfer swagger requests to Postman and set the parameters while GET requests and use them while POST/PUT requests?
2. How can I update these requests whenever the request parameters are changed on Swagger?
Postman has an manual option to import open-api. But in your case you need a utility. Thankfully postman team has written a converter.
Postman provides an open source project to convert OpenAPI 3.0 specs to the Postman Collection (v2).
It provides a CLI openapi2postmanv2
$ openapi2postmanv2 -s spec.yaml -o collection.json -p -O folderStrategy=Tags,includeAuthInfoInExample=false
Add it to your build process, so you dont have to manually convert.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With