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.
Option 1: Postman to OpenAPI (Website)
Section titled “Option 1: Postman to OpenAPI (Website)”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.
Option 2: postman-to-OpenAPI (CLI)
Section titled “Option 2: postman-to-OpenAPI (CLI)”This is a simple CLI command line tool called postman-to-openapi.
Prerequisites
Section titled “Prerequisites”Install npm
Section titled “Install npm”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 npmOn Windows (or any system) you can use the prebuilt installer from Node’s website here.
Install postman-to-OpenAPI
Section titled “Install postman-to-OpenAPI”Now that you have npm installed, you can run the command:
npm install -g postman-to-openapiRun the p2o command
Section titled “Run the p2o command”Now you can run the command:
p2o ./path/to/PostmantoCollection.json -f ./path/to/result.yml