Postman to swagger
We like to use postman, but often we get asked for swagger docs. There doesn't seem to be any open source postman v2.0.0
=> swagger/openApi tools. Maybe a commercial reason, here is one for you.
Usage
; const convertAndSave = { // This returns the actual swagger v2.0 spec as a json const swaggerJson = ; // Example if you want to save it somewhere fs;};
With swagger-ui-express
;;; swagger;// Static stuffswagger;
What it converts
- name, description, version
- routes, folders
- examples, status codes
Demo
# Build this lib npm run build# Go into demo folder and install npm install# Then run the demo npm run watch
Future improvement
- Apimatic has this
models
thing that is kind of useful, maybe we can also do that. - Use
lodash/fp
,lodash/fp/flow
to slim down module size
Repos to watch
- api-flow - broken, but maybe inspiring.
- postman2swagger2 - Doesn't support postman v2