download-openapi
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese下载 OpenAPI JSON
Download OpenAPI JSON
使用底层命令,不包含本地脚本包装。
Use underlying commands without local script wrappers.
前置条件
Prerequisites
在目标项目安装 aptx 包,并确保可执行 :
aptx-ftbash
pnpm add -D @aptx/frontend-tk-cliInstall the aptx package in the target project and ensure is executable:
aptx-ftbash
pnpm add -D @aptx/frontend-tk-cli执行步骤
Execution Steps
- 选择输出文件路径(建议 )。
./openapi.json - 执行下载命令。
- 下载成功后,把该文件路径交给其他技能(如模型生成、请求框架生成)。
bash
pnpm exec aptx-ft input download --url <url> --output <file>可选(未使用 pnpm 时):
bash
npx aptx-ft input download --url <url> --output <file>示例:
bash
pnpm exec aptx-ft input download --url https://api.example.com/swagger.json --output ./openapi.json- Select the output file path (recommended: ).
./openapi.json - Execute the download command.
- After successful download, pass the file path to other skills (such as model generation, request framework generation).
bash
pnpm exec aptx-ft input download --url <url> --output <file>Alternative (when not using pnpm):
bash
npx aptx-ft input download --url <url> --output <file>Example:
bash
pnpm exec aptx-ft input download --url https://api.example.com/swagger.json --output ./openapi.json输出
Output
- 本地 OpenAPI JSON 文件(例如 )。
./openapi.json
- Local OpenAPI JSON file (e.g., ).
./openapi.json
边界
Boundaries
本 skill 仅处理 OpenAPI JSON 格式的下载:
- 不支持 YAML 格式的 OpenAPI 规范
- 不处理需要认证的 URL(如需要 Bearer Token)
- 不处理自定义请求头
- 下载后不自动验证 OpenAPI 规范的有效性(仅验证 JSON 语法)
如需上述功能,请手动下载后使用其他工具处理。
This skill only handles downloads of OpenAPI JSON format:
- Does not support OpenAPI specifications in YAML format
- Does not handle URLs requiring authentication (e.g., those needing a Bearer Token)
- Does not handle custom request headers
- Does not automatically validate the validity of the OpenAPI specification after download (only validates JSON syntax)
For the above-mentioned functionalities, please download manually and process with other tools.