Agent-skills postman-openapi-converter
install
source · Clone the upstream repo
git clone https://github.com/LambdaTest/agent-skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/LambdaTest/agent-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/api/Postman/postman-openapi-converter" ~/.claude/skills/lambdatest-agent-skills-postman-openapi-converter && rm -rf "$T"
manifest:
api/Postman/postman-openapi-converter/SKILL.mdsource content
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:
→ OpenAPI 3openapi: 3.x.x
→ Swagger 2swagger: "2.0"
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 |
|---|---|
| Collection name |
| Collection description |
| variable |
| One request item per operation |
or | Request name |
(path/query/header) | URL path variables, query params, headers |
| Body (raw JSON), generate example from schema |
| Saved example responses |
| Collection-level auth |
| Folder grouping |
Swagger 2 → Postman
| Swagger field | Postman mapping |
|---|---|
+ | |
| Request item |
| Query/path/header/body params |
/ | Content-Type / Accept headers |
| Collection auth |
| Folders |
Step 3 — Generate Example Bodies
For each request with a
requestBody or body parameter, generate a realistic example JSON body from the schema:
- Use property names as keys
- Infer sensible example values from type + format (e.g.,
format →"email"
,"user@example.com"
→"date-time"
)"2024-01-15T10:30:00Z" - For
schemas, resolve them inline$ref
Step 4 — Auth Handling
Map security schemes to Postman auth:
| OpenAPI scheme | Postman auth type |
|---|---|
| with |
| with / |
| header with |
| query param |
| (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:
- Always group by
into folderstags - Include
field on each request fromdescription
+operationId
+summarydescription - Add saved example responses where
are defined in the specresponses
"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:
frombase_url
orservers[0].urlhost + basePath
,token
,api_key
,username
as empty placeholderspassword- Any server variables from
servers[0].variables
Step 7 — Output
— Full Postman Collection v2.1collection.json
— Matching environment fileenvironment.json- Conversion summary: number of endpoints converted, folders created, auth type detected, any fields skipped or approximated
- Import instructions
Edge Cases
chains: Resolve all$ref
pointers inline before mapping$ref
/allOf
/oneOf
: Use the first/primary schema for body generation; note alternatives in descriptionanyOf- Path parameters: Convert
to{param}
in URL path AND add to:param
array in url objectvariable - Multiple content types: Prefer
; note others in request descriptionapplication/json - No operationId: Generate name from
(e.g.,METHOD /path
→GET /users/{id}
)Get User by ID
Quality Checklist
- Every
entry produces at least one requestpaths - Path params use
format in Postman URL:param - All
resolved — no raw$ref
strings in output$ref - Auth tokens are
, never hardcoded{{variables}} - JSON output is valid and importable
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:
- Check if the API Documentation skill is available in the installed skills list
- If the skill is available:
- Read and follow the instructions in the API Documentation skill
- Use the API design output above as the input
- If the skill is NOT available:
- Inform the user: "It looks like the API Documentation skill isn't installed. You can install it and re-run.
If the user says no:
- End the task here