Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update Postman collection from Swagger

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?

like image 330
Jack Avatar asked Oct 19 '25 08:10

Jack


1 Answers

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.

like image 191
Sorter Avatar answered Oct 20 '25 22:10

Sorter



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!