Search code examples
postmanpostman-native-app

How to programmatically generate a collection from an openAPI / Swagger endpoint?


Generating a Postman collection from an openAPI / Swagger documentation JSON file is already possible using the Postman API Client (a desktop app).

However, for purposes of programmatically modifying an existing collection using the NodeJs-based Postman SDK I'd like to be able to automate the process of generating a postman collection.

Whether that is via a command line tool (I haven't found any such tool), Postman API REST request (I haven't been able to find out how) or otherwise, does not really matter.

As long as it is possible to do without pressing a button in some app.

Is this possible at all?


Solution

  • Postman uses this module in the APP to convert from OpenAPI to a Postman Collection.

    https://github.com/postmanlabs/OpenAPI-to-Postman

    This should provide you with a programmatical way of doing this outside of the app.