@scalar/postman-to-openapi
v0.7.7
Published
Converts Postman collections to OpenAPI documents
Readme
Postman to OpenAPI Converter
Convert Postman collections to the open standard OpenAPI. Free the postman!
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.
