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-ft
bash
pnpm add -D @aptx/frontend-tk-cli
Install the aptx package in the target project and ensure
aptx-ft
is executable:
bash
pnpm add -D @aptx/frontend-tk-cli

执行步骤

Execution Steps

  1. 选择输出文件路径(建议
    ./openapi.json
    )。
  2. 执行下载命令。
  3. 下载成功后,把该文件路径交给其他技能(如模型生成、请求框架生成)。
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
  1. Select the output file path (recommended:
    ./openapi.json
    ).
  2. Execute the download command.
  3. 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.