From 37f4d5b660a0a7c199970b94f0644290032a5f8a Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 29 Nov 2024 17:49:02 +0100 Subject: [PATCH] chore: correction --- src/commands/openapi/refs.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/commands/openapi/refs.ts b/src/commands/openapi/refs.ts index ecff19360..de997c9c2 100644 --- a/src/commands/openapi/refs.ts +++ b/src/commands/openapi/refs.ts @@ -222,8 +222,7 @@ export default class OpenAPISolvingCircularityAndRecursiveness extends BaseComma const initialCircularRefs = await OpenAPISolvingCircularityAndRecursiveness.getCircularRefsFromOas(openApiData); if (initialCircularRefs.length === 0) { - chalk.green('The file does not contain circular or recursive references.'); - return; + throw new Error('The file does not contain circular or recursive references.'); } debug(`Found ${initialCircularRefs.length} circular references. Attempting resolution.`); @@ -293,8 +292,6 @@ export default class OpenAPISolvingCircularityAndRecursiveness extends BaseComma const { preparedSpec, specPath } = await prepareOas(spec, 'openapi:refs', { convertToLatest: true }); const openApiData = JSON.parse(preparedSpec); - await OpenAPISolvingCircularityAndRecursiveness.resolveCircularRefs(openApiData, openApiData.components!.schemas!); - try { await OpenAPISolvingCircularityAndRecursiveness.resolveCircularRefs( openApiData,