postman-update-oas
v0.0.1
Published
This script updates an existing Postman collection with an updated OpenAPI file. It reads the OpenAPI file, converts it to a Postman collection, and updates the specified Postman collection using the Postman API.
Downloads
3
Readme
OpenAPI to Postman Collection Updater
This script updates an existing Postman collection with an updated OpenAPI file. It reads the OpenAPI file, converts it to a Postman collection, and updates the specified Postman collection using the Postman API.
You can use this script in order to keep downstream forks and stars intact.
Prerequisites
- Node.js installed
- A
.env
file with your Postman API key (POSTMAN_API_KEY)
Installation
- Clone the repository
- Run
npm install
to install dependencies
Usage
$ node index.js <OAS_FILE_PATH> <COLLECTION_ID>
Where:
<OAS_FILE_PATH>
: The path to your OpenAPI file<COLLECTION_ID>
: The Postman collection ID you want to update
Example
$ node script.js 'petstore.yaml' '308093-acbc504c-c371-432f-b7e0-8f8afc0f5364'
This command will update the Postman collection with the specified ID using the OpenAPI file provided.
Troubleshooting
If you encounter any issues, ensure that:
- Your Postman API key is set correctly in the
.env
file - The OpenAPI file path is correct and the file is accessible
- The Postman collection ID is correct and exists in your Postman account