This tools can update postman collection from swagger json, to avoid create every time.
Note: The tools will merge old config with new, but for request body, it will keep the exist one, not merge.
-
Clone this repository
-
Install packages
Make sure you have install nodejs. Then in project root folder, run
npm install
to install libs. -
Get your postman api key
Just open this link in your broswer, and generate your api key. -
Set api key as environment.
Copy.env.sample
to.env
file, then set the api key you get in the previous step. -
Rename
config/default-example.json
file toconfig/default.json
and edit like bellow{ "test":{ "collection_name":"test import", "url":"http://127.0.0.1:8085/v2/api-docs" } }
The key is command line value name.
collection_name
is the postman collection name you want to update.url
is your swagger url. -
Run update
In project root folder, open command line and runnode index.js -s test
you can also install as gloabl cli. runsudo npm link
in root folder, then useapih -s test
everywhere!
Merge same name collection
- openapi-to-postman/OPTIONS.md at develop · postmanlabs/openapi-to-postman
- Update Collection - Postman Public Workspace
- axios - npm
- postmanlabs/swagger2-postman2: Module and library to convert Swagger 2.0 to a Postman Collection (v2.0)
- boschni/json-merger: Merge JSON files and objects with indicators like $import $remove $replace $merge