Skip to content

Script to help with creating a Postman Workspace from a list of multiple SwaggerHub API definitions

Notifications You must be signed in to change notification settings

adamtry/postman-from-swaggerhubs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Postman from Swagger Generator

Uses the Postman API to create a workspace and set of collections based on a list of Swagger JSON or SwaggerHub URLs

You'll need a Postman account to import the collections into

Dependencies:

  • Python 3 (current version) with pip package manager Install from here
  • Python requests library. Install with python -m pip install -r requirements.txt or otherwise

Setup:

  1. Visit the Postman API Key Generation Page and generate a new API key (or use an existing one)
  2. Save the key in this directory in a file named postman_api_key.txt (gitignored)
  3. Create and/or open the swagger_json_urls.txt (gitignored) file and list the Swagger json pages to add to the Postman workspace
    • Public Swagger json links should end with swagger.json
    • SwaggerHub links should start with https://app.swaggerhub.com or https://api.swaggerhub.com and end with the version
    • These should be separated with line breaks only, example:
https://app.swaggerhub.com/apis/MyOrganisation/myFirstApiName/1.1.0
https://app.swaggerhub.com/apis/MyOrganisation/mySecondApiName/2.3.0
  1. Open the config.json file and edit the values as needed. To add collections to an existing workspace, specify the exact name of your existing workspace

Run:

  1. Run the index.py file with python index.py or otherwise
  2. Follow the link printed to the console after a successful run (you may need to log in with Web Postman first)
  3. The collections may have a SwaggerHub URL set under the Collection Variables for the baseUrl, so you should edit these for each collection
  4. Add any other environment or collection variables as needed

About

Script to help with creating a Postman Workspace from a list of multiple SwaggerHub API definitions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages