This Node.js tool generates Swagger documentation from a Postman collection.
Make sure you have Node.js and NPM installed. If not, you can follow these installation guides:
-
For Ubuntu/Linux, click here.
-
For Windows, click here.
Follow these steps to install the tool on your local system:
-
Clone the repository:
git clone https://github.com/niveussolutions/Swagger-tool.git
-
Change to the cloned repo directory:
cd Swagger-tool
-
Install all dependencies:
npm install
-
Run the following command:
npm run swagger-ui
-
Specify the location of your Postman collection, the destination path, and the name of your Swagger document. Run the project with:
npm run swagger-converter "your_postman_collection_path" "your_output_file_path"
Example:
npm run swagger-converter "/home/niveus/Downloads/example.postman_collection.json" "/home/niveus/Downloads/example_output.yaml"
-
Ensure that your requests are beautified (you can use the beautify option in Postman), and all Postman requests should be in a single folder, not grouped within the main folder.
-
Before using the tool, update it once by running the following command within the Swagger-tool directory:
npm run updateTool