Skip to content

Commit

Permalink
chore: correction
Browse files Browse the repository at this point in the history
  • Loading branch information
admin committed Nov 29, 2024
1 parent 43f2c82 commit 37f4d5b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/commands/openapi/refs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.`);
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 37f4d5b

Please sign in to comment.