Name: swagger2-to-postman
Owner: Postman
Description: Converter for swagger 2.0 JSON to Postman Collection
Created: 2015-03-21 10:51:23.0
Updated: 2018-01-12 16:52:22.0
Pushed: 2018-01-16 21:37:45.0
Size: 80
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Converter for swagger 2.0 JSON to Postman Collection v1
run $ npm install
to install the dependencies
run $ npm test
to see the converter in action
convert.js provides a jsFace class - Swagger2Postman. Check test/converter.spec.js for basic usage.
Initialise class:
var swaggerConverter = new Swagger2Postman();
Optionally, set a logger:
swaggerConverter.setLogger(console.log);
Convert your Swagger 2.0 JSON:
var convertResult = swaggerConverter.convert(swaggerJson);
Check the result:
convertResult.status === "failed"
for unsuccessful conversions. Check convertResult.message
convertResult.status === "passed"
for successful conversions. Check convertResult.collection for the Postman collection JSON
Optional Configuration Parameters: The constructor can also take in a map of configuration options
options = {
cludeQueryParams: false
swaggerConverter = new Swagger2Postman(options);
valid options are: includeQueryParams - (default true) Include query string parameters in the request url.