Convert OpenAPI specs to Postman collections
Converts an OpenAPI 3.x or Swagger 2.0 spec into an import-ready Postman Collection v2.1 with generated example bodies and auth mapping.
Why it matters
Transform OpenAPI specification files into Postman collection format to enable API testing and documentation workflows without manual conversion. This skill bridges API design tools and testing platforms by automating the translation between OpenAPI and Postman formats.
Outcomes
What it gets done
Parse OpenAPI specification files and extract endpoint definitions
Map OpenAPI schemas to Postman collection structure and format
Generate Postman-compatible request examples with parameters
Export complete Postman collections ready for import and testing
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/ag-postman-openapi-converter | bash Overview
OpenAPI → Postman Collection Converter
This skill converts an OpenAPI 3.x or Swagger 2.0 spec into a Postman Collection v2.1, mapping paths, parameters, and security schemes to Postman fields, generating realistic example bodies, and grouping requests into tag-based folders. Use it whenever a user has an existing OpenAPI or Swagger spec to convert into a Postman collection. For building a collection from a plain-English description with no spec, use the companion collection generator skill instead.
What it does
Converts an OpenAPI 3.x or Swagger 2.0 spec (YAML or JSON) into a valid, import-ready Postman Collection v2.1 - distinct from building a collection from a plain-English description, which is a companion skill. Step 1 detects the spec version from its openapi: 3.x.x or swagger: "2.0" marker, converting whatever is present and noting missing sections if the input is truncated. Step 2 applies a fixed field mapping per spec version: for OpenAPI 3, info.title/info.description become the collection name/description, servers[0].url becomes the {{base_url}} variable, each paths.<path>.<method> becomes one request item named from its operationId or summary, parameters map to path/query/header fields, requestBody schema becomes a generated raw JSON body, responses become saved example responses, components.securitySchemes becomes collection-level auth, and tags become folders; for Swagger 2, host+basePath form {{base_url}}, consumes/produces map to Content-Type/Accept headers, and securityDefinitions map to collection auth. Step 3 generates a realistic example JSON body for every request with a body schema, inferring sensible values from property type and format (an email-format field becomes "user@example.com", a date-time field becomes an ISO timestamp) and resolving $ref schemas inline. Step 4 maps each OpenAPI security scheme to its Postman auth equivalent - http: bearer to Postman's bearer auth with a {{token}} variable, http: basic to basic auth with {{username}}/{{password}}, apiKey in header or query to the matching Postman apikey type, and oauth2 to Postman's oauth2 type with a note that manual token setup is still required - applying it at the collection level when every endpoint shares the scheme, overriding per-request otherwise. Step 5 builds the standard v2.1 collection structure (same schema as the plain-language collection generator), but always groups requests into folders by tags and attaches saved example responses built from the spec's documented response bodies. Step 6 extracts a companion environment file with base_url plus empty placeholders for any detected token/api_key/username/password variables and any servers[0].variables. Named edge cases get explicit handling: resolving $ref chains fully before mapping, using the primary schema for allOf/oneOf/anyOf bodies while noting alternatives, converting {param} path syntax to Postman's :param format in both the URL and its variable array, preferring application/json when multiple content types exist, and synthesizing a request name from method and path (GET /users/{id} becomes "Get User by ID") when no operationId exists. A quality checklist before output confirms every path produces a request, path params use :param format, no raw $ref strings remain, auth values are variables not hardcoded strings, and the JSON is valid.
When to use - and when NOT to
Use it whenever a user provides or references an OpenAPI spec, Swagger file, openapi.yaml, or swagger.json and wants it converted to a Postman collection. For building a collection from a plain-English API description or cURL commands with no existing spec, use the companion Postman collection generator skill instead - this one specifically parses and maps an existing OpenAPI/Swagger document.
Inputs and outputs
Input is an OpenAPI 3.x or Swagger 2.0 spec in YAML or JSON, complete or partial. Output is a Postman Collection v2.1 JSON with folders grouped by tag and generated example bodies/responses, a companion environment file, and a conversion summary (endpoints converted, folders created, auth type detected, any fields skipped or approximated).
Integrations
Produces Postman Collection v2.1 and Environment JSON from OpenAPI 3.x or Swagger 2.0 input, and hands off to a companion API Documentation skill on request, using the converted collection as its input.
Who it's for
API developers who already have an OpenAPI or Swagger spec and want a properly-mapped, example-populated Postman collection (correct auth type, tag-based folders, generated request bodies) without hand-converting the spec themselves.
Source README
OpenAPI → Postman Collection Converter
When to Use
Use this skill when you need 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",...
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: 3.x.x→ OpenAPI 3swagger: "2.0"→ Swagger 2
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:
- Use property names as keys
- Infer sensible example values from type + format (e.g.,
"email"format →"user@example.com","date-time"→"2024-01-15T10:30:00Z") - For
$refschemas, resolve them inline
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:
- Always group by
tagsinto folders - Include
descriptionfield on each request fromoperationId+summary+description - Add saved example responses where
responsesare defined in the spec
"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:
base_urlfromservers[0].urlorhost + basePathtoken,api_key,username,passwordas empty placeholders- Any server variables from
servers[0].variables
Step 7 - Output
collection.json- Full Postman Collection v2.1environment.json- Matching environment file- Conversion summary: number of endpoints converted, folders created, auth type detected, any fields skipped or approximated
- Import instructions
Edge Cases
$refchains: Resolve all$refpointers inline before mappingallOf/oneOf/anyOf: Use the first/primary schema for body generation; note alternatives in description- Path parameters: Convert
{param}to:paramin URL path AND add tovariablearray in url object - Multiple content types: Prefer
application/json; note others in request description - No operationId: Generate name from
METHOD /path(e.g.,GET /users/{id}→Get User by ID)
Quality Checklist
- Every
pathsentry produces at least one request - Path params use
:paramformat in Postman URL - All
$refresolved - no raw$refstrings in output - Auth tokens are
{{variables}}, never hardcoded - 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.
- Inform the user: "It looks like the API Documentation skill isn't installed.
If the user says no:
- End the task here
Limitations
- Use this skill only when the task clearly matches its upstream source and local project context.
- Verify commands, generated code, dependencies, credentials, and external service behavior before applying changes.
- Do not treat examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.