Automatically sync OpenAPI/Swagger spec to collection

Hello,

I’ve recently started exploring the use of Swagger documentation with our teams that currently use Postman for API test automation. The ability to import a spec and have it created as a collection in postman is great. As the team continues to develop and refactor the APIs and the spec is therefore updated, is there a way to have these updates to the spec synced with the postman collection that was created upon initial import. I’ve see some converters that seem a bit clunky.

Does Postman plan on building this into the tool at some point?

The ability to have this would streamlined would greatly enhance the tool.

thanks,

7 Likes

Hi @obasekia, Thanks for writing in!
Currently we don’t have a 2 way sync between Postman schema and collection but you can generate new collection from the updated schema and replace the older one. This is just a workaround for now till the time we come up with a solution.
It is definitely in our roadmap and we’ll keep you posted on developments.

1 Like

Thanks for the response vansh.singh. This is something that myself and many others (from what I’ve read) would be very interested in.

The only concern I have with importing the swagger spec each time is that our test and variables will not be maintained, unless I’m missing something.

I believe even a 1 way sync that would update your Postman collection each time a change has been made to the swagger spec would be very useful.

Thanks,

1 Like

@vansh.singh,
Is there a way through the Postman API to replace the collection?

I’m trying to setup my CI tool to:

  1. upload my OpenAPI spec to Postman (as a collection)
  2. replace the old collection with the new one

Ideally I want a URL that persists so I can share one link to my Postman collection with customers.

Hi @bwillemsen, you can upload your API spec to Postman as a collection but we don’t have collection update flow as of now.
You can go through Postman cloud API documentation to get the API.
https://docs.api.getpostman.com/?version=latest#09886971-e1e2-4a62-8f59-f7abfd79ff5e

This is a required featured. Everytime generating a new collection is tiresome.

4 Likes

Bump. Not only is it tiresome but it also doesn’t allow the test you’ve created to persist. @vansh.singh has there been any update on this?

1 Like

The fact that you cant change a mock server’s collection means you break the url for any one every time you make a change to your swagger file and reimport. This makes this whole process very tedious. I would say step 1 would be allowing mock servers to change collections to allow for the already manual task of creating new api, new collection

Hey!

We’re tracking this feature here: Add an option to "Update Collection" generated from the APIs tab · Issue #6722 · postmanlabs/postman-app-support · GitHub

I’ve added the feedback you’ve currently posted but we’re eager for more to design the best solution possible, please refer to that message and let us know your use-cases either directly on the issue or here. :slight_smile:

This is a must-have feature, please implement it ASAP!

Is this feature implemented?

I don’t think so, I’m looking for it now and ended up here.

Openapi files are generated. Need to constantly import into postman. Points to this feature.

I remember opening an issue with Postman about refreshing collections from Swagger some years ago (which I can’t find since they reorganised their repos).

Even after all these years this is still not possible - what a joke!

And if I recall correctly there was a period of time when reimporting from existing Swagger issued a prompt if you want to overwrite existing collection or create a new one. Now it just defaults to creating another copy.

This really is a product that completely lost sight of their target audience.

Is this implemented? Right Now , using oistman API , we can delete the collection and create new one but not able to update the existing one

Having a way to update the postman collection in 1 way sync will be an amazing productivity booster, especially at tracking changes to the API in postman.
Postman already has the basic features for this 1 way sync:
1- generate a fork from the existing collection
2- automatically create a PR with the changes from the sync
3- the user gets to choose to merge / resolve conflicts and this allows for a really nice version control of the API in an API specialist software.

I hope the Postman team implements this in the near future

1 Like

The closed pull request is not doing what is requested here, people wants an automation to pull recurrently the last schema generated by an external swagger definition to keep it updated as people adds more stuff. The main idea of this request is to not need to manually update the definition file but getting sync every N amount of seconds

1 Like

Did an actual search because I just didn’t believe ChatGPT when it told me this was not possible natively.

I am actually in more disbelief now? Or confused?