Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changeset/great-hoops-repeat.md
Original file line number Diff line number Diff line change
@@ -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.
10 changes: 10 additions & 0 deletions packages/plugins/openapi/src/providers/google/discovery.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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");
Expand Down
1 change: 1 addition & 0 deletions packages/plugins/openapi/src/providers/google/discovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ type GoogleDiscoveryServiceOverride = {
};

const GOOGLE_DISCOVERY_SERVICE_OVERRIDES: Record<string, GoogleDiscoveryServiceOverride> = {
analyticsdata: { preserveServiceHostedUrl: true },
forms: { preserveServiceHostedUrl: true },
keep: { preserveServiceHostedUrl: true },
[GOOGLE_PHOTOS_PICKER_SERVICE]: {
Expand Down
Loading