Elysia Tools Docs
ZH
语言
ZHESPTRUFRDEEN
返回主站
浏览工具

Development

OpenAPI 转 Postman Collection

把 OpenAPI 3.x 或 Swagger 2.0 规范(JSON/YAML)转成可直接导入的 Postman Collection v2.1.0,含文件夹、变量、认证与示例响应。

file· 文件结果打开工具

快速开始

用三种语言从你的代码中调用此工具。

cURL
curl -X POST 'https://api.elysiatools.com/zh/api/tools/openapi-to-postman-collection' \
  -H 'Content-Type: application/json' \
  -d '{"openapiSpec":"{\n  \"openapi\": \"3.0.3\",\n  \"info\": {\n    \"title\": \"Petstore Lite API\",\n    \"version\": \"1.0.0\",\n    \"description\": \"A small sample pet store API.\"\n  },\n  \"servers\": [\n    {\n      \"url\": \"https://api.example.com/v1\"\n    }\n  ],\n  \"paths\": {\n    \"/pets\": {\n      \"get\": {\n        \"summary\": \"List pets\",\n        \"operationId\": \"listPets\",\n        \"parameters\": [\n          {\n            \"name\": \"limit\",\n            \"in\": \"query\",\n            \"description\": \"How many items to return\",\n            \"schema\": {\n              \"type\": \"integer\",\n              \"minimum\": 1,\n              \"maximum\": 100\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"A list of pets\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"id\": {\n                      \"type\": \"integer\"\n                    },\n                    \"name\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                }\n              }\n            }\n          }\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create a pet\",\n        \"requestBody\": {\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"$ref\": \"#/components/schemas/Pet\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Created\"\n          }\n        }\n      }\n    },\n    \"/pets/{petId}\": {\n      \"get\": {\n        \"summary\": \"Get one pet\",\n        \"parameters\": [\n          {\n            \"name\": \"petId\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"description\": \"The pet id\",\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"A single pet\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/Pet\"\n                }\n              }\n            }\n          }\n        }\n      }\n    }\n  },\n  \"components\": {\n    \"schemas\": {\n      \"Pet\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"tag\": {\n            \"type\": \"string\"\n          }\n        }\n      }\n    }\n  }\n}","folderStrategy":"paths","includeExamples":true,"includeAuth":true}'

© 2026 Elysia Tools. 开发者文档。

返回主站浏览工具

API 参考

以 JSON 形式 POST 提交输入参数。文件类型参数需先单独上传。

请求端点

HTTP
POST https://api.elysiatools.com/zh/api/tools/openapi-to-postman-collection

请求参数

参数名类型必填说明
openapiSpectextarea是—
folderStrategyselect否—
includeExamplescheckbox否—
includeAuthcheckbox否—

响应格式

文件结果

JSON
{
  "filePath": "/public/processing/randomid.ext",
  "fileName": "output.ext",
  "contentType": "application/octet-stream",
  "size": 1024,
  "metadata": {
    "key": "value"
  },
  "error": "Error message (optional)",
  "message": "Notification message (optional)"
}

MCP 集成

将此工具加入你的 Model Context Protocol 服务,让 AI 智能体可以列出并调用它。

服务配置

将以下内容加入你的 MCP 客户端配置:

mcp.json
{
  "mcpServers": {
    "elysiatools-openapi-to-postman-collection": {
      "name": "openapi-to-postman-collection",
      "description": "把 OpenAPI 3.x 或 Swagger 2.0 规范(JSON/YAML)转成可直接导入的 Postman Collection v2.1.0,含文件夹、变量、认证与示例响应。",
      "baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=openapi-to-postman-collection",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

列出可用工具

连接到 SSE 端点后,列出已开放的工具:

tools/list
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/list"
}

调用此工具

通过工具 id 调用,参数由其参数表构建:

tools/call
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "openapi-to-postman-collection",
    "arguments": {
  "openapiSpec": "{\n  \"openapi\": \"3.0.3\",\n  \"info\": {\n    \"title\": \"Petstore Lite API\",\n    \"version\": \"1.0.0\",\n    \"description\": \"A small sample pet store API.\"\n  },\n  \"servers\": [\n    {\n      \"url\": \"https://api.example.com/v1\"\n    }\n  ],\n  \"paths\": {\n    \"/pets\": {\n      \"get\": {\n        \"summary\": \"List pets\",\n        \"operationId\": \"listPets\",\n        \"parameters\": [\n          {\n            \"name\": \"limit\",\n            \"in\": \"query\",\n            \"description\": \"How many items to return\",\n            \"schema\": {\n              \"type\": \"integer\",\n              \"minimum\": 1,\n              \"maximum\": 100\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"A list of pets\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"type\": \"object\",\n                  \"properties\": {\n                    \"id\": {\n                      \"type\": \"integer\"\n                    },\n                    \"name\": {\n                      \"type\": \"string\"\n                    }\n                  }\n                }\n              }\n            }\n          }\n        }\n      },\n      \"post\": {\n        \"summary\": \"Create a pet\",\n        \"requestBody\": {\n          \"content\": {\n            \"application/json\": {\n              \"schema\": {\n                \"$ref\": \"#/components/schemas/Pet\"\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"201\": {\n            \"description\": \"Created\"\n          }\n        }\n      }\n    },\n    \"/pets/{petId}\": {\n      \"get\": {\n        \"summary\": \"Get one pet\",\n        \"parameters\": [\n          {\n            \"name\": \"petId\",\n            \"in\": \"path\",\n            \"required\": true,\n            \"description\": \"The pet id\",\n            \"schema\": {\n              \"type\": \"string\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"A single pet\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/Pet\"\n                }\n              }\n            }\n          }\n        }\n      }\n    }\n  },\n  \"components\": {\n    \"schemas\": {\n      \"Pet\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"tag\": {\n            \"type\": \"string\"\n          }\n        }\n      }\n    }\n  }\n}",
  "folderStrategy": "paths",
  "includeExamples": true,
  "includeAuth": true
}
  }
}
可用逗号分隔的 toolId 在一个会话中串联多个工具,例如 /mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp(最多 20 个)。

有问题或反馈?请联系 [email protected]

浏览工具
打开工具