From fdac96c8220888f1cc70dd53e8151d66fe32ef47 Mon Sep 17 00:00:00 2001 From: Sergio Date: Fri, 14 Apr 2023 21:44:06 +0200 Subject: [PATCH] fix: correct problem of broken build caused by scattered files in multiple directories The parsing function was unable to handle subfolders, despite indicating that it could. Therefore, I added bundling prior to parsing, and this appears to have resolved the issue. fix #169 --- src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index c7026aa..b8101c8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -85,7 +85,8 @@ export function transfromSwagger(inputDoc: AllSwaggerDocumentVersions, options: */ export async function transformFile(options: Options): Promise { const swaggerParser = new SwaggerParser(); - const $refs: SwaggerParser.$Refs = await swaggerParser.resolve(options.input); + const bundle = await swaggerParser.bundle(options.input); + const $refs: SwaggerParser.$Refs = await swaggerParser.resolve(bundle); const dereferencedDocument = partiallyDereference(swaggerParser.api, $refs); const markdown = transfromSwagger(dereferencedDocument, options);