Skip to content

Convert a Postman collection to an OpenAPI definition.

License

Notifications You must be signed in to change notification settings

infamousjoeg/postman2openapi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

postman2openapi

Convert Postman collections to OpenAPI definitions.

Build status

Try it on the Web: https://kevinswiber.github.io/postman2openapi/

CLI

Installation

Archives of precompiled binaries for postman2openapi are available for Windows, macOS and Linux.

Linux binaries are static executables. Windows binaries are available either as built with MinGW (GNU) or with Microsoft Visual C++ (MSVC). When possible, prefer MSVC over GNU, but you'll need to have the Microsoft VC++ 2015 redistributable installed.

For Rust developers, installation is also available via Cargo. Installing Rust and Cargo

To install the latest published version on crates.io, use:

cargo install postman2openapi --features binary

To install from the latest on GitHub, use:

cargo install --git https://github.com/kevinswiber/postman2openapi --features binary

Usage

USAGE:
    postman2openapi [OPTIONS] [input-file]

ARGS:
    <input-file>    The Postman collection to convert; data may also come from stdin

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -o, --output <format>    The output format [default: yaml]  [possible values: yaml, json]

Examples

postman2openapi collection.json > openapi.yaml
cat collection.json | postman2openapi -o json

Node.js library

Installation

npm install postman2openapi

Usage

const collection = require('./collection'); // any Postman collection JSON file
const { transpile } = require('postman2openapi');

const postman = JSON.stringify(collection);
const openapi = transpile(postman, 'yaml');

console.log(openapi);

JavaScript API

transpile(collection: string, format: string): string

  • collection - a stringified version of a Postman JSON object.
  • format - the return format, either json or yaml.
  • returns - an OpenAPI definition in the format specified.

License

Apache License 2.0 (Apache-2.0)

Copyright © 2020 Kevin Swiber [email protected]

About

Convert a Postman collection to an OpenAPI definition.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 99.9%
  • Shell 0.1%