Skip to content
This repository has been archived by the owner on Dec 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #98 from joolfe/develop
Browse files Browse the repository at this point in the history
Update readme to improve npm view
  • Loading branch information
joolfe authored Mar 30, 2021
2 parents 6755dda + 6dcce8b commit dcdf5af
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 10 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
### [1.7.1](https://github.com/joolfe/postman-to-openapi/compare/1.7.0...1.7.1) (2021-03-30)


### Bug Fixes

* vulnerability high fixed in deps ([2e4a2cb](https://github.com/joolfe/postman-to-openapi/commit/2e4a2cb8cf7cb612ad05bd5e3664686d98d31094))


### Documentation

* add quick usage in readme Close [#95](https://github.com/joolfe/postman-to-openapi/issues/95) ([194b1a4](https://github.com/joolfe/postman-to-openapi/commit/194b1a4185da70cc00cf3994093b10b68f381c62))

## [1.7.0](https://github.com/joolfe/postman-to-openapi/compare/1.6.1...1.7.0) (2021-03-28)


Expand Down
47 changes: 46 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,52 @@ Or in other words, transform [this specification](https://schema.getpostman.com/
[![codecov](https://codecov.io/gh/joolfe/postman-to-openapi/branch/master/graph/badge.svg)](https://codecov.io/gh/joolfe/postman-to-openapi)
[![npm version](https://img.shields.io/npm/v/postman-to-openapi
)](https://www.npmjs.com/package/postman-to-openapi)
[![dcos](https://img.shields.io/badge/docs-here-yellow)](https://joolfe.github.io/postman-to-openapi/)
[![docs](https://img.shields.io/badge/docs-here-yellow)](https://joolfe.github.io/postman-to-openapi/)

## Installation

Using `npm`:

```bash
npm i postman-to-openapi
```

Using `yarn`:

```bash
yarn add postman-to-openapi
```

## Quick Usage

```js
// Require Package
const postmanToOpenApi = require('postman-to-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)
})
```

## Documentation

Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "postman-to-openapi",
"version": "1.7.0",
"version": "1.7.1",
"description": "Convert postman collection to OpenAPI spec",
"main": "lib/index.js",
"scripts": {
Expand Down

0 comments on commit dcdf5af

Please sign in to comment.