From daeb916a5710820e074ea0a6d98b0a16bc727bed Mon Sep 17 00:00:00 2001 From: smrht <62819456+smrht@users.noreply.github.com> Date: Sun, 6 Sep 2026 09:19:56 +0200 Subject: [PATCH] fix(openapi): fetch analyticsdata Discovery from the service host The central Discovery directory does not list the GA4 Data API, so https://www.googleapis.com/discovery/v1/apis/analyticsdata/v1beta/rest answers 404 and importing the source fails. Route analyticsdata to its own host the way forms, keep and photospicker already are. --- .changeset/great-hoops-repeat.md | 9 +++++++++ .../openapi/src/providers/google/discovery.test.ts | 10 ++++++++++ .../plugins/openapi/src/providers/google/discovery.ts | 1 + 3 files changed, 20 insertions(+) create mode 100644 .changeset/great-hoops-repeat.md diff --git a/.changeset/great-hoops-repeat.md b/.changeset/great-hoops-repeat.md new file mode 100644 index 0000000000..9943a92068 --- /dev/null +++ b/.changeset/great-hoops-repeat.md @@ -0,0 +1,9 @@ +--- +"@executor-js/plugin-openapi": patch +--- + +Fetch Google Analytics Data (`analyticsdata`) Discovery from the service's own +host. The central directory does not list the GA4 Data API, so the canonical +`https://www.googleapis.com/discovery/v1/apis/analyticsdata/v1beta/rest` answers +404 and the source fails to import. Same treatment `forms`, `keep` and +`photospicker` already get. diff --git a/packages/plugins/openapi/src/providers/google/discovery.test.ts b/packages/plugins/openapi/src/providers/google/discovery.test.ts index 748f8bc917..a6a6f18702 100644 --- a/packages/plugins/openapi/src/providers/google/discovery.test.ts +++ b/packages/plugins/openapi/src/providers/google/discovery.test.ts @@ -159,6 +159,11 @@ it("accepts only supported HTTPS Google Discovery endpoints", () => { "https://www.googleapis.com/discovery/v1/apis/photospicker/v1/rest", ), ).toBe("https://photospicker.googleapis.com/$discovery/rest?version=v1"); + expect( + normalizeGoogleDiscoveryUrl( + "https://www.googleapis.com/discovery/v1/apis/analyticsdata/v1beta/rest", + ), + ).toBe("https://analyticsdata.googleapis.com/$discovery/rest?version=v1beta"); expect( normalizeGoogleDiscoveryUrl("https://www.googleapis.com/discovery/v1/apis/forms/v1/rest"), ).toBe("https://forms.googleapis.com/$discovery/rest?version=v1"); @@ -171,6 +176,11 @@ it("accepts only supported HTTPS Google Discovery endpoints", () => { expect( normalizeGoogleDiscoveryUrl("https://photospicker.googleapis.com/$discovery/rest?version=v1"), ).toBe("https://photospicker.googleapis.com/$discovery/rest?version=v1"); + expect( + normalizeGoogleDiscoveryUrl( + "https://analyticsdata.googleapis.com/$discovery/rest?version=v1beta", + ), + ).toBe("https://analyticsdata.googleapis.com/$discovery/rest?version=v1beta"); expect( normalizeGoogleDiscoveryUrl("https://forms.googleapis.com/$discovery/rest?version=v1"), ).toBe("https://forms.googleapis.com/$discovery/rest?version=v1"); diff --git a/packages/plugins/openapi/src/providers/google/discovery.ts b/packages/plugins/openapi/src/providers/google/discovery.ts index 9d79076986..8d346561c3 100644 --- a/packages/plugins/openapi/src/providers/google/discovery.ts +++ b/packages/plugins/openapi/src/providers/google/discovery.ts @@ -41,6 +41,7 @@ type GoogleDiscoveryServiceOverride = { }; const GOOGLE_DISCOVERY_SERVICE_OVERRIDES: Record = { + analyticsdata: { preserveServiceHostedUrl: true }, forms: { preserveServiceHostedUrl: true }, keep: { preserveServiceHostedUrl: true }, [GOOGLE_PHOTOS_PICKER_SERVICE]: {