Skip to content

Postman Collections

How to Convert Postman Collection to OpenAPI Spec

Section titled “How to Convert Postman Collection to OpenAPI Spec”

A Swagger file must be provided to test REST APIs with NightVision. If your organization uses Postman instead, export your Postman collection to JSON and then convert it into a Swagger file.

This is the easiest way to convert a Postman collection. Navigate to this website: Postman to OpenAPI. You can upload your Postman collection, and it will convert it to OpenAPI v3.

This is a simple CLI command line tool called postman-to-openapi.

First, have npm installed. If you’re on Windows, follow the Windows installation instructions.

If you’re on a Mac, you can install npm with Homebrew:

brew install npm

On Windows (or any system) you can use the prebuilt installer from Node’s website here.

Now that you have npm installed, you can run the command:

npm install -g postman-to-openapi

Now you can run the command:

Terminal window
p2o ./path/to/PostmantoCollection.json -f ./path/to/result.yml