UNPKG

@lonu/stc

Version:

A tool for converting OpenApi/Swagger/Apifox into code.

14 lines 621 B
import type { ISwaggerResult } from "./swagger.js"; /** * 解析 OpenAPI/Swagger 文档内容,支持 JSON 和 YAML 两种格式 * * 解析策略: * 1. 来源路径扩展名为 `.yaml`/`.yml` 时,直接按 YAML 解析 * 2. 其余情况优先按 JSON 解析,失败后回退为 YAML 解析(兼容无扩展名的远程地址) * * @param content - 文档文本内容 * @param source - 来源文件路径或远程地址,用于格式检测 * @returns 解析后的 Swagger 结果 */ export declare const parseSpec: (content: string, source?: string) => ISwaggerResult; //# sourceMappingURL=parser.d.ts.map