8000 GitHub - cunkz/postman-to-openapi: 🛸 Convert postman collection to OpenAPI
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

🛸 Convert postman collection to OpenAPI

License

Notifications You must be signed in to change notification settings

cunkz/postman-to-openapi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installation

Using npm:

npm i postman-ke-openapi

Using yarn:

yarn add postman-ke-openapi

To install as a cli just

npm i postman-ke-openapi -g

Quick Usage

As a library

// Require Package
const postmanToOpenApi = require('postman-ke-openapi')

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

// Async/await
try {
    const result = await postmanToOpenApi(postmanCollection, outputFile, { defaultTag: 'General' })
    // Without save the result in a file
    const result2 = await postmanToOpenApi(postmanCollection, null, { defaultTag: 'General' })
    console.log(`OpenAPI specs: ${result}`)
} catch (err) {
    console.log(err)
}

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

As a cli

p2o ./path/to/PostmantoCollection.json -f ./path/to/result.yml -o ./path/to/options.json

Cli Demo

cli demo gif

Documentation

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

Credits

All credits goes to joolfe. I re-publish this package because my PR didnt get any response.

Tags

Nodejs Javascript OpenAPI Postman Newman Collection Transform Convert

License

See the LICENSE file.

About

🛸 Convert postman collection to OpenAPI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 96.1%
  • TypeScript 3.7%
  • Shell 0.2%
0