Postman openapi converter

From LambdaTest/agent-skills · View interactive version

Postman openapi converter is an AI agent skill from the GitHub repository LambdaTest/agent-skills. Convert OpenAPI 3.x or Swagger 2.0 specs (YAML or JSON) into complete, import-ready Postman Collection v2.1 JSON files. Use this skill whenever the user provides or references an OpenAPI spec, Swagger file, openapi.yaml, swagger.json, or uses phrases like "convert my OpenAPI spec", "import swagger t

How to use this skill

Skill file

OpenAPI → Postman Collection Converter

Converts OpenAPI 3.x or Swagger 2.0 specs into a valid Postman Collection v2.1.


Step 1 — Detect & Validate Input

Identify the spec version from the input:

If the input is truncated or partial, convert what's available and note missing sections.


Step 2 — Extraction Mapping

OpenAPI 3 → Postman

| OpenAPI field | Postman mapping |

|---|---|

| info.title | Collection name |

| info.description | Collection description |

| servers[0].url | {{base_url}} variable |

| paths.<path>.<method> | One request item per operation |

| operationId or summary | Request name |

| parameters (path/query/header) | URL path variables, query params, headers |

| requestBody.content.application/json.schema | Body (raw JSON), generate example from schema |

| responses | Saved example responses |

| components.securitySchemes | Collection-level auth |

| tags | Folder grouping |

Swagger 2 → Postman

| Swagger field | Postman mapping |

|---|---|

| host + basePath | {{base_url}} |

| paths.<path>.<method> | Request item |

| parameters | Query/path/header/body params |

| consumes / produces | Content-Type / Accept headers |

| securityDefinitions | Collection auth |

| tags | Folders |


Step 3 — Generate Example Bodies

For each request with a requestBody or body parameter, generate a realistic example JSON body from the schema:


Step 4 — Auth Handling

Map security schemes to Postman auth:

| OpenAPI scheme | Postman auth type |

|---|---|

| http: bearer | bearer with {{token}} |

| http: basic | basic with {{username}} / {{password}} |

| apiKey: header | apikey header with {{api_key}} |

| apiKey: query | apikey query param |

| oauth2 | oauth2 (note: requires manual token setup) |

Apply auth at collection level if all endpoints share the same scheme. Override at request level for exceptions.


Step 5 — Build Collection JSON

Use the standard v2.1 structure (same schema as postman-collection-generator skill).

Key differences for spec-converted collections:

"response": [
  {
    "name": "200 OK",
    "status": "OK",
    "code": 200,
    "header": [{ "key": "Content-Type", "value": "application/json" }],
    "body": "{ \"id\": 1, \"name\": \"example\" }",
    "originalRequest": { <copy of the request> }
  }
]

Step 6 — Environment File

Extract all variables into a companion environment:


Step 7 — Output

  1. collection.json — Full Postman Collection v2.1
  2. environment.json — Matching environment file
  3. Conversion summary: number of endpoints converted, folders created, auth type detected, any fields skipped or approximated
  4. Import instructions

Edge Cases


Quality Checklist


After Completing the API Design

Once the API design output is delivered, ask the user:

"Would you like me to generate API documentation for this design? (yes/no)"

If the user says yes:

You can install it and re-run.

If the user says no:


Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.