Skip to main content

OpenAPI & Swagger to Postman Collection Generator

Convert OpenAPI 3.0/3.1 and Swagger JSON/YAML into Postman Collections and Environment files with folder grouping by tags

OpenAPI & Swagger to Postman Collection Generator

Supports JSON & YAML (editor.swagger.io format)

Was this OpenAPI & Swagger to Postman Collection Generator helpful?

Help us keep tools reliable, fast, and bug-free.

What you can do with OpenAPI & Swagger to Postman Collection Generator

  • Convert swagger to postman collection
  • Export openapi to postman

How this developer utility works

Convert OpenAPI 3.0/3.1 or Swagger 2.0 JSON/YAML specifications into Postman Collection v2.1, Postman Environment, and cURL output.

Example input

{"openapi":"3.0.0","info":{"title":"User API","version":"1.0.0"},"paths":{"/users":{"get":{"summary":"List users"}}}}

Example output

{"info":{"name":"User API","schema":"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},"item":[{"name":"List users","request":{"method":"GET","url":"{{baseUrl}}/users"}}]}

Practical workflow

  1. Paste an OpenAPI or Swagger specification in JSON or YAML format; the sample starts with a fictional API at api.example.com.
  2. Review the generated Postman Collection v2.1. Operations are grouped under their first tag, or under General when no tag is present.
  3. Select the Postman Environment tab for the first server URL, or Batch cURL for shell commands using the specification's server URL.
  4. Copy the current output or download the collection or environment JSON, then inspect and configure it in Postman before sending requests.

Common use cases

  • Converting newly written OpenAPI specifications into runnable Postman workspaces for QA teams.
  • Migrating legacy Swagger 2.0 definitions into modern Postman Collection v2.1 format.
  • Creating a Postman starting collection from an existing API contract without sending the specification to a service.

Important notes and limitations

  • The converter handles GET, POST, PUT, PATCH, and DELETE operations, query parameters, path placeholders, and JSON request bodies. It uses only the first server URL.
  • It does not interpret OpenAPI security schemes or add Authorization headers. Configure authentication after import; cURL path placeholders such as :userId must be replaced before running.

OpenAPI & Swagger CLI conversion tools

CLI convert OpenAPI 3.0 spec to Postman collection v2.1

npx --yes openapi-to-postmanv2 -s openapi.yaml -o postman_collection.json -p

Converts OpenAPI YAML specification into a structured Postman collection with request bodies and headers.

Validate OpenAPI specification syntax with spectral

npx --yes @stoplight/spectral-cli lint openapi.yaml

Lints OpenAPI specifications for schema syntax errors, missing parameter descriptions, and broken refs.

Convert Swagger 2.0 to OpenAPI 3.0 via swagger2openapi

npx --yes swagger2openapi --yaml swagger.json -o openapi3.yaml

Upgrades legacy Swagger 2.0 JSON definitions to modern OpenAPI 3.0 YAML specifications.

API Specification Formats & Postman Schema Comparison

Specification FormatVersionPrimary Schema SyntaxPostman Collection CompatibilityKey Advantage
OpenAPI 3.13.1.0Full JSON Schema 2020-12 alignmentSupported via Postman Collection v2.1 importNative union types and full JSON Schema keyword compatibility
OpenAPI 3.03.0.3Extended subset of JSON Schema draft-04100% native Postman collection importBroadest tooling support across code generators and API gateways
Swagger 2.02.0 (Legacy)Swagger JSON Schema dialectLegacy supportHistorical legacy format, missing components/requestBodies
Postman Collectionv2.1.0Postman proprietary JSON execution schemaNative execution environmentPre-request scripts, environment variables, Newman CLI automation

OpenAPI to Postman schema conversion troubleshooting

Circular $ref detected / conversion terminates unexpectedly

Cause: Schema definitions reference themselves (e.g. Tree Node containing children: [Node]), causing infinite loops during generation.

Solution: Enable schema resolution limits in converter settings or limit recursion depth to 2 levels.

Missing base URL / collection requests default to {{baseUrl}} without value

Cause: The OpenAPI specification lacks a 'servers' array (e.g. servers: [{ url: 'https://api.example.com' }]).

Solution: Add a valid server URL under the 'servers:' key in OpenAPI or define {{baseUrl}} in Postman collection variables.

Request body examples rendered as empty or null

Cause: OpenAPI schema defines types without providing 'example' or 'default' properties for model fields.

Solution: Add 'example: "sample-value"' to your OpenAPI property definitions so Postman can populate mock payloads.

Continue your workflow

  • API Request Tester — Execute and test individual HTTP requests defined in your OpenAPI specification.
  • cURL to Code — Convert cURL commands generated from OpenAPI schemas into multi-language snippets.
  • JSON Schema Validator — Validate request and response JSON payloads against OpenAPI schema definitions.
  • Mock API Generator — Generate realistic mock data payloads matching your OpenAPI model schemas.

Frequently asked questions

Does this converter support both Swagger 2.0 and OpenAPI 3.1?

Yes. The parser recognizes both legacy Swagger 2.0 documents and modern OpenAPI 3.0 / 3.1 specifications in either JSON or YAML format.

Does the converter read security schemes or add authentication tokens?

No. It does not interpret security schemes and does not add Authorization headers. Configure authentication in Postman after import, and keep real credentials out of shared specifications.

How are the generated Postman requests grouped?

Each operation is placed under its first OpenAPI tag. Operations without a tag are placed in a General folder; the tool does not offer a path-based grouping control.