diff --git a/.changeset/hungry-peas-sing.md b/.changeset/hungry-peas-sing.md new file mode 100644 index 0000000000..8c39d33ddd --- /dev/null +++ b/.changeset/hungry-peas-sing.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend-module-openapi': patch +--- + +Fixed bug in `jsonSchemaRefPlaceholderResolver` where relative $ref files were resolved through file system instead of base URL of file diff --git a/plugins/catalog-backend-module-openapi/src/lib/bundle.ts b/plugins/catalog-backend-module-openapi/src/lib/bundle.ts index 64c772b91e..59f7e5791f 100644 --- a/plugins/catalog-backend-module-openapi/src/lib/bundle.ts +++ b/plugins/catalog-backend-module-openapi/src/lib/bundle.ts @@ -65,6 +65,6 @@ export async function bundleFileWithRefs( }, }; const fileObject = parse(fileWithRefs); - const bundledObject = await $RefParser.bundle(fileObject, options); + const bundledObject = await $RefParser.bundle(baseUrl, fileObject, options); return stringify(bundledObject); }