A web-based tool that converts Postman Collections (v2.x) to OpenAPI 3.0 Specifications. Built with Next.js, TypeScript, and Tailwind CSS.
- 🔄 Convert Postman Collections to OpenAPI 3.0 Specifications
- 📝 Support for both YAML and JSON output formats
- 📋 One-click copy functionality
- 🎨 Clean and responsive UI
- ⚡ Real-time conversion
- 🛠️ Handles complex Postman collection structures
- 🔍 Detailed error reporting
- 💼 Preserves request metadata (descriptions, examples, etc.)
- ✅ Basic request details (URL, method, description)
- ✅ Query parameters
- ✅ Path parameters
- ✅ Headers
- ✅ Request bodies (raw JSON and form-data)
- ✅ Collection folder structure (converted to tags)
- ✅ Authentication schemes (Basic and Digest)
- Node.js 18.x or later
- npm or yarn
- Clone the repository:
git clone https://github.com/yourusername/postman-openapi-converter.git
cd postman-openapi-converter
- Install dependencies:
npm install
# or
yarn install
- Run the development server:
npm run dev
# or
yarn dev
- Open http://localhost:3000 in your browser.
- Build the application:
npm run build
# or
yarn build
- Start the production server:
npm start
# or
yarn start
-
Prepare Your Postman Collection
- Export your Postman Collection (Collection v2.x format)
- Copy the JSON content
-
Convert the Collection
- Paste the Postman Collection JSON into the left textarea
- Click the "Convert" button
- Select your preferred output format (YAML or JSON)
-
Use the Result
- Copy the converted OpenAPI specification using the copy button
- Use the specification in your OpenAPI tools
Input (Postman Collection):
{
"info": {
"name": "Sample API",
"description": "A sample API collection"
},
"item": [
{
"name": "Get Users",
"request": {
"method": "GET",
"url": {
"raw": "https://api.example.com/users",
"path": ["users"],
"query": [
{
"key": "page",
"value": "1",
"description": "Page number"
}
]
},
"description": "Get all users"
}
}
]
}
Output (OpenAPI 3.0):
openapi: 3.0.3
info:
title: Sample API
description: A sample API collection
version: 1.0.0
paths:
/users:
get:
summary: Get Users
description: Get all users
parameters:
- name: page
in: query
schema:
type: string
example: "1"
description: Page number
responses:
'200':
description: Successful response
- Framework: Next.js 14
- Language: TypeScript
- Styling: Tailwind CSS
- UI Components: shadcn/ui
- Icons: Lucide React
PostmanToOpenAPIConverter.tsx
: Main component containing the converter logicparseUrl()
: Handles URL parsing from Postman formatprocessParameters()
: Processes query parameters, path parameters, and headersprocessRequestBody()
: Handles request body conversiontoYAML()
: Converts JavaScript objects to YAML formatconvertToOpenAPI()
: Main conversion logic for Postman to OpenAPI
- Parses the input Postman Collection JSON
- Extracts collection metadata (name, description)
- Processes each request in the collection:
- Converts URL and path parameters
- Processes request headers
- Handles request bodies
- Maps collection folders to OpenAPI tags
- Generates the OpenAPI specification
- Outputs in either YAML or JSON format
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
- Only supports Postman Collection Format v2.x
- Limited support for complex authentication schemes
- Does not handle environment variables
- No support for response examples
- Limited support for non-JSON request bodies
- Support for Postman Collection Format v2.1
- Handle Postman environment variables
- Add support for response examples
- Implement more authentication schemes
- Add batch conversion support
- Add file upload/download functionality
- Implement OpenAPI to Postman conversion
- Add validation for OpenAPI output
This project is licensed under the MIT License - see the LICENSE file for details.
- Postman for their amazing API development ecosystem
- OpenAPI Initiative for the OpenAPI Specification
- shadcn/ui for the beautiful UI components
For any questions or suggestions, please open an issue or contact the maintainers.
Made with ❤️ by Wisdom Nwokocha and [Prince]