@readme/postman-to-openapi
TypeScript icon, indicating that this package has built-in type declarations

4.1.0 • Public • Published

@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.

/@readme/postman-to-openapi/

    Package Sidebar

    Install

    npm i @readme/postman-to-openapi

    Weekly Downloads

    117,565

    Version

    4.1.0

    License

    MIT

    Unpacked Size

    76 kB

    Total Files

    12

    Last publish

    Collaborators

    • darrenyong
    • gratcliff
    • dannobytes
    • gkoberger
    • domharrington
    • mjcuva
    • kanadgupta
    • jonursenbach
    • rafegoldberg
    • dashron
    • iliast