Skip to content

readmeio/postman-to-openapi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@readme/postman-to-openapi

🛸 Convert Postman Collection v2.1/v2.0 to OpenAPI v3.0.

Or in other words, transform this specification and also this to this one

build npm version CodeQL

Installation

Using npm:

npm i @readme/postman-to-openapi

Using yarn:

yarn add @readme/postman-to-openapi

Quick Usage

As a library

const postmanToOpenAPI = require('postman-to-openapi')

// Postman collection
const postmanCollection = './path/to/postman/collection.json'
// Output OpenAPI Path
const outputFile = './api/collection.yml'

postmanToOpenAPI(postmanCollection, outputFile, { defaultTag: 'General' })
  .then(result => {
    console.log(`OpenAPI specs: ${result}`)
  })
  .catch(err => {
    console.log(err)
  })

Documentation

All features, usage instructions and help can be found in the Documentation page

Differences from postman-to-openapi

There are some small differences between this library and the postman-to-openapi upstream:

  • Does not ship with a CLI component.
  • Has protections in place to prevent undefined statuses from being set.
  • Has no version property on the exported method to determine which version you're running as this is unnecessary without a CLI component.

About

🛸 Convert postman collection to OpenAPI

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 95.9%
  • TypeScript 4.0%
  • Shell 0.1%