GithubHelp home page GithubHelp logo

vctqs1 / postman2openapi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kevinswiber/postman2openapi

0.0 0.0 0.0 1.17 MB

Convert a Postman collection to an OpenAPI definition.

License: Apache License 2.0

Shell 0.25% JavaScript 1.04% Rust 90.80% CSS 5.15% HTML 0.74% Dockerfile 1.23% Just 0.80%

postman2openapi's Introduction

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-cli

To install from the latest on GitHub, use:

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

Usage

USAGE:
    postman2openapi [OPTIONS] [input-file]

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

OPTIONS:
    -f, --output-format <format>    The output format [default: yaml] [possible values: yaml, json]
    -h, --help                      Print help information
    -V, --version                   Print version information

Examples

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

JavaScript library

Installation

npm install postman2openapi

Usage

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

// Returns a JavaScript object representation of the OpenAPI definition.
const openapi = transpile(collection);

console.log(JSON.stringify(openapi, null, 2));

JavaScript API

transpile(collection: object): object

  • collection - An object representing the Postman collection.
  • returns - an OpenAPI definition as a JavaScript object.

Build

Note: A Dev Container is included for convenience.

To take advantage of build recipes, install just.

just build

Builds the Rust library and the CLI packages.

just test

Runs all lint checks (cargo fmt --check, cargo clippy) and runs all tests, including tests for wasm32-unknown-unknown targets (Node.js, Chrome, Firefox).

just start-web

Builds the WebAssembly project and starts a local version of the postman2openapi site.

just prepare

Builds the Rust library, the CLI, the Node.js library, and the Web site. Then all tests are run.

License

Apache License 2.0 (Apache-2.0)

postman2openapi's People

Contributors

kevinswiber avatar wajeshubham avatar soundstep avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.