From d4965ffd287ed3248e7675fd2ebf40f9e6be2604 Mon Sep 17 00:00:00 2001 From: Gabriel Testault Date: Wed, 3 May 2023 16:51:16 +0200 Subject: [PATCH 1/2] fix(catalog-backend-module-openapi): resolve refs from OpenAPI spec baseUrl Signed-off-by: Gabriel Testault --- plugins/catalog-backend-module-openapi/src/lib/bundle.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } From accaceadffaf7c06f459066f95f1bb2a835e3e16 Mon Sep 17 00:00:00 2001 From: Gabriel Testault Date: Wed, 3 May 2023 16:56:47 +0200 Subject: [PATCH 2/2] fix(catalog-backend-module-openapi): changeset Signed-off-by: Gabriel Testault --- .changeset/hungry-peas-sing.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/hungry-peas-sing.md 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