From 757a061478d68e4be092fbe247b6f145f6872eed Mon Sep 17 00:00:00 2001 From: Tobias Zipfel Date: Mon, 3 Nov 2025 12:50:37 +0100 Subject: [PATCH] refactoring Signed-off-by: Tobias Zipfel --- plugins/catalog-backend-module-openapi/src/lib/bundle.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/catalog-backend-module-openapi/src/lib/bundle.ts b/plugins/catalog-backend-module-openapi/src/lib/bundle.ts index 086934d973..2a3df4ab54 100644 --- a/plugins/catalog-backend-module-openapi/src/lib/bundle.ts +++ b/plugins/catalog-backend-module-openapi/src/lib/bundle.ts @@ -54,8 +54,6 @@ export async function bundleFileWithRefs( read: BundlerRead, resolveUrl: BundlerResolveUrl, ): Promise { - const fileObject = parse(fileWithRefs); - const fileUrlReaderResolver: ResolverOptions = { canRead: file => { const protocol = getProtocol(file.url); @@ -84,6 +82,8 @@ export async function bundleFileWithRefs( }, }; + const fileObject = parse(fileWithRefs); + if (fileObject.asyncapi) { const version = parseInt(fileObject.asyncapi, 10); @@ -98,7 +98,6 @@ export async function bundleFileWithRefs( } } - // Use generic bundler for OpenAPI documents only const bundledObject = await $RefParser.bundle(fileObject, options); return stringify(bundledObject); }