本文へスキップ
Skillpedia
一般的なプログラミング48k · #5478

postman-openapi-converter

できること

このツールは、OpenAPIやSwaggerといった形式で書かれたAPIの説明を、Postman(APIをテストするためのツール)が読み込めるファイルに変換します。APIの呼び出しをまとめた「Postmanコレクション」を作成します。

使う場面

  • ✓OpenAPIまたはSwagger形式でAPIを説明したファイルがあり、それをPostmanでテストしたいとき。
  • ✓古いAPIの説明(Swagger 2.0)から、新しい形式に移行したいとき。
  • ✓既存のドキュメントをもとに、Postmanでの API 呼び出しを自動的に整理したいとき。

スキルのリンク

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/postman-openapi-converter/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/postman-openapi-converter/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“この OpenAPI ファイルを Postman コレクションに変換してください:[ファイルへのリンク、または内容をここに貼り付け]”

毎週5つの新しいスキル。1分で読めます。

仕組み

このツールは、APIの説明(OpenAPI/Swagger)を読み取り、さまざまなパスやメソッド(GET、POSTなど)を特定して、Postman用のコレクションファイルを作成します。また、サンプルデータの生成や認証の設定も自動で行おうとします。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

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 3
  • swagger: "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 $ref schemas, 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 tags into folders
  • Include description field on each request from operationId + summary + description
  • Add saved example responses where responses are 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_url from servers[0].url or host + basePath
  • token, api_key, username, password as empty placeholders
  • Any server variables from servers[0].variables

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

  • $ref chains: Resolve all $ref pointers inline before mapping
  • allOf / oneOf / anyOf: Use the first/primary schema for body generation; note alternatives in description
  • Path parameters: Convert {param} to :param in URL path AND add to variable array 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 paths entry produces at least one request
  • Path params use :param format in Postman URL
  • All $ref resolved — no raw $ref strings in output

…

よくある質問

OpenAPI/Swaggerとは何ですか?

APIの仕組みを記述するための標準化された形式です。エンドポイント、パラメーター、想定されるレスポンスなどを記述します。

Postmanコレクションとは何ですか?

Postmanで複数のAPIリクエストをまとめたファイルです。整理、共有、テストの実行が簡単になります。

このツールはすべての種類の認証に対応していますか?

Bearerトークン、Basic認証、APIキーなどの一般的な認証方法を、Postmanの設定に対応づけようとします。ただし、より複雑なOAuth2の設定では、手動での調整が必要になる場合があります。

詳細

作者による元の説明

Convert OpenAPI 3.x or Swagger 2.0 specs (YAML or JSON) into complete, import-ready Postman Collection v2.1 JSON files.

repo: sickn33/agentic-awesome-skills

人気

GitHubのスター
48k
ランキング
#5478
ライセンス
MIT
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル