@scalar/postman-to-openapi
v0.7.14
Published
Converts Postman collections to OpenAPI documents
Readme
Postman to OpenAPI Converter
Convert Postman collections to the open standard OpenAPI. Free the postman!
Scalar is an open-source API platform for teams who want beautiful developer interfaces without vendor lock-in.
- API References — Interactive API documentation from OpenAPI and AsyncAPI specs.
- Developer Docs — Write in Markdown/MDX, generate API references, sync with two-way Git.
- SDK Generator — Type-safe SDKs and CLIs in TypeScript, Python, Go, PHP, Java, and Ruby.
- API Client — Open-source, offline-first Postman alternative built on OpenAPI.
20M+ monthly npm installs · 15,500+ GitHub stars · MIT licensed · scalar.com
Installation
npm install @scalar/postman-to-openapiUsage
import { convert } from '@scalar/postman-to-openapi'
// Free the postman!
const result = await convert(myPostmanCollection)
console.log(result)Detect Postman collections
Use isPostmanCollection to decide whether an input string should be parsed as a Postman collection before converting.
import { convert, isPostmanCollection } from '@scalar/postman-to-openapi'
if (isPostmanCollection(input)) {
const openApiDocument = convert(input)
console.log(openApiDocument)
}isPostmanCollection accepts exported collections that do not include info._postman_id as long as they contain a valid Postman schema URL and an item tree.
Community
We are API nerds. You too? Let's chat on Discord: https://discord.gg/scalar
Thank you!
This package is based on the existing postman-to-openapi by @joolfe. We update the code and adapted it to our use case. You might consider our package the modern successor.
