What is Swagger to Postman Collection Converter?
OpenAPI (formerly Swagger) specifications describe REST API endpoints, parameters, request bodies, and authentication schemes in a structured format — either JSON or YAML. Postman Collections provide an interactive, executable representation of those same APIs that developers can use for manual testing, automated testing, documentation, and team collaboration. Converting an OpenAPI spec to a Postman Collection bridges the gap between API design and API testing: instead of manually creating each request in Postman, you import the entire specification and get a ready-to-use collection with all endpoints, parameters, headers, and example request bodies pre-populated. This converter supports both OpenAPI 3.x and Swagger 2.0 specifications, handles path parameters, query parameters, and request headers, generates example JSON request bodies from schema definitions, and preserves authentication configurations including API Key, Bearer Token, Basic Auth, and OAuth2. Requests are organized by tags for easy navigation, and the base URL is set as a collection variable so you can switch environments without editing individual requests.
How to Use
- Paste your OpenAPI 3.x or Swagger 2.0 specification into the input area — both JSON and YAML formats are accepted
- Click "Convert to Postman" to generate a Postman Collection v2.1 JSON document
- Review the output to verify that all endpoints, parameters, and authentication schemes were captured correctly
- Download the JSON file and import it into Postman via File → Import → Upload Files, or copy the JSON and use Import → Paste Raw Text
- Replace placeholder authentication values (<token>, <api-key>, etc.) with actual credentials in your Postman environment
Why Use This Tool?
Tips & Best Practices
- Use tags in your OpenAPI spec to group related endpoints — the converter creates folders in Postman based on these tags
- Add descriptions to parameters and operations in your spec — they carry over to Postman as inline documentation
- The base URL is stored as a collection variable ({{baseUrl}}) — create Postman environments with different baseUrl values for dev, staging, and production
- Example values are auto-generated from schema types and enums — replace them with realistic test data after importing
- After importing, use Postman's "Run Collection" feature to execute all requests in sequence for a quick smoke test
Frequently Asked Questions
What input formats are supported?
Both JSON and YAML formats are accepted for OpenAPI 3.x (identified by the "openapi" field) and Swagger 2.0 (identified by the "swagger" field). The converter auto-detects the format based on the content — JSON inputs start with { or [, while YAML inputs are parsed from indented key-value syntax.
How is authentication handled during conversion?
Security schemes defined in the spec — API Key, HTTP Basic, HTTP Bearer, and OAuth2 — are converted to Postman auth configurations. Placeholder values like <token> and <api-key> are inserted where actual credentials go. After importing, replace these placeholders with real values in your Postman environment variables.
When should I NOT use this converter?
Avoid this converter if your API uses GraphQL, gRPC, or WebSocket protocols — it only handles REST APIs described by OpenAPI/Swagger. Also, if your Postman collection requires advanced features like pre-request scripts, test assertions, or variable chaining, you will need to add those manually after importing the generated collection.
Are request bodies generated from schemas?
Yes. For OpenAPI 3.x specs with requestBody definitions, the converter generates example JSON bodies by resolving schema properties, types, and enums. For $ref references to component schemas, the tool creates placeholder objects. You may need to adjust the generated examples with more realistic test data.
Can I import the output directly into Postman?
Yes. Download the JSON file using the Download button, then import it into Postman via File → Import → Upload Files. Alternatively, copy the JSON output and use Import → Paste Raw Text. The collection will appear with all endpoints organized by tags, ready for testing.
Is my API specification sent to a server?
No. All parsing, conversion, and collection generation happen entirely in your browser. Your API specification — including endpoints, parameters, and authentication schemes — never leaves your device, making this tool safe for use with proprietary or internal API designs.
Real-world Examples
Pet Store API — OpenAPI 3.0 to Postman
Convert the standard Pet Store OpenAPI 3.0 specification into a Postman collection with organized endpoints for pet management.
{
"openapi": "3.0.0",
"info": { "title": "Pet Store API", "version": "1.0.0" },
"servers": [{ "url": "https://petstore.swagger.io/v2" }],
"paths": {
"/pet": {
"post": {
"summary": "Add a new pet",
"requestBody": {
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/Pet" }
}
}
},
"responses": { "200": { "description": "Success" } }
}
}
},
"components": {
"schemas": {
"Pet": {
"type": "object",
"properties": {
"id": { "type": "integer" },
"name": { "type": "string" },
"status": { "type": "string", "enum": ["available", "pending", "sold"] }
}
}
}
}
}{
"info": {
"name": "Pet Store API",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Add a new pet",
"request": {
"method": "POST",
"url": { "raw": "{{baseUrl}}/pet", "host": ["{{baseUrl}}"], "path": ["pet"] },
"body": {
"mode": "raw",
"raw": "{\n \"id\": 0,\n \"name\": \"string\",\n \"status\": \"available\"\n}",
"options": { "raw": { "language": "json" } }
}
}
}
],
"variable": [{ "key": "baseUrl", "value": "https://petstore.swagger.io/v2" }]
}Swagger 2.0 User API to Postman
Convert a Swagger 2.0 specification for a user management API into a Postman collection with path parameters and query parameters.
{
"swagger": "2.0",
"info": { "title": "User API", "version": "1.0.0" },
"host": "api.example.com",
"basePath": "/v1",
"schemes": ["https"],
"paths": {
"/users": {
"get": {
"summary": "List users",
"parameters": [
{ "name": "page", "in": "query", "type": "integer" },
{ "name": "limit", "in": "query", "type": "integer" }
],
"responses": { "200": { "description": "Success" } }
}
},
"/users/{id}": {
"get": {
"summary": "Get user by ID",
"parameters": [
{ "name": "id", "in": "path", "required": true, "type": "integer" }
],
"responses": { "200": { "description": "Success" } }
}
}
}
}{
"info": {
"name": "User API",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "List users",
"request": {
"method": "GET",
"url": {
"raw": "{{baseUrl}}/users?page=&limit=",
"host": ["{{baseUrl}}"],
"path": ["users"],
"query": [
{ "key": "page", "value": "" },
{ "key": "limit", "value": "" }
]
}
}
},
{
"name": "Get user by ID",
"request": {
"method": "GET",
"url": {
"raw": "{{baseUrl}}/users/:id",
"host": ["{{baseUrl}}"],
"path": ["users", ":id"],
"variable": [{ "key": "id", "value": ":id" }]
}
}
}
],
"variable": [{ "key": "baseUrl", "value": "https://api.example.com/v1" }]
}