Skip to content

Plugin for converting OpenAPI 3.0 specs to the Postman Collection (v2) format

License

Notifications You must be signed in to change notification settings

lanxin11/openapi-to-postman

 
 

Repository files navigation

Overview

This repository helps you to convert an OpenAPI 3.0 spec, such as the Quickstart API spec (swaggerv2API.yaml), to a file format that is much easier to be imported into Postman. Also, the code samples are also imported with less manual tweaking work.

Intallation

To use the converter as a Node module, you need to have a copy of the NodeJS runtime. The easiest way to do this is through npm. If you have NodeJS installed you have npm installed as well.

$ npm install openapi-to-postmanv2

If you want to use the converter in the CLI, install it globally with NPM:

$ npm i -g openapi-to-postmanv2

Usage

  1. Download the OpenAPI spec for the Quickstart API to your local environment.

  2. Change directory to the folder where you store the API spec for the Quickstart API.

  3. In terminal, run the following command:

openapi2postmanv2 -s swaggerv2API.yaml -o specv2API.json -p -O folderStrategy=Tags,requestParametersResolution=Example,optimizeConversion=false,stackLimit=100
  1. To import the collection in Postman, click Import in your workspace, then choose the JSON file that the converter generated (specv2API.json). It will take no more than one minute to finish importing.

For more information about commands and other advanced options, check this repository.

About

Plugin for converting OpenAPI 3.0 specs to the Postman Collection (v2) format

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 99.7%
  • Shell 0.3%