Skip to content

Commit

Permalink
fix: parse spec using ref-parser bundle() to handle circular refs
Browse files Browse the repository at this point in the history
  • Loading branch information
dgellow committed Jan 16, 2025
1 parent 21985a2 commit 202e865
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/cli/src/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export async function configureExtensionsUserProvided(
specFilePathOrObject: string | object,
cliParamOptions: { [option: string]: any }
): Promise<void> {
const result = decycle(await new $RefParser().dereference(specFilePathOrObject));
const result = decycle(await new $RefParser().bundle(specFilePathOrObject));

resetJSONSchemaGenerator();

Expand Down
4 changes: 1 addition & 3 deletions packages/http/src/utils/operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ export async function getHttpOperationsFromSpec(specFilePathOrObject: string | o
'User-Agent': `PrismMockServer/${prismVersion} (${os.type()} ${os.arch()} ${os.release()})`,
},
};
const result = decycle(
await new $RefParser().dereference(specFilePathOrObject, { resolve: { http: httpResolverOpts } })
);
const result = decycle(await new $RefParser().bundle(specFilePathOrObject, { resolve: { http: httpResolverOpts } }));

let operations: IHttpOperation[] = [];
if (isOpenAPI2(result)) operations = transformOas2Operations(result);
Expand Down

0 comments on commit 202e865

Please sign in to comment.