I am developing a REST API. during development I have used postman (chrome extension) to use and document my API. It is a wonderful tool and I have most of my API endpoints in it. However, as we near release I would like to document this API in swagger, how would I do that? Is there a way that I can generate swagger based off of the postman export?
APIMatic API Transformer can process a Postman collection (v1 or v2) as an input format and produce Swagger 1.2 or 2.0, and now OpenAPI 3.0.0 as output.
It has its own API and a Web front-end, and also a command-line version.
Someone posted this link (and deleted it?): http://restunited.com/
It accepts postman JSON and converts it to swagger. This seems to be what I was looking for.
You can use https://github.com/stoplightio/api-spec-converter with code
var transformer = require('api-spec-transformer');
var postmanToSwagger = new transformer.Converter(transformer.Formats.POSTMAN, transformer.Formats.SWAGGER);
postmanToSwagger.loadFile('/path/to/your.json.postman_collection', function(err) {
if (err) {
console.log(err.stack);
return;
}
postmanToSwagger.convert('yaml')
.then(function(convertedData) {
// convertedData is swagger YAML string
console.log(convertedData);
})
.catch(function(err){
console.log(err);
});
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With