Support service-hosted Google Discovery documents
Extended gogcli's generic API discovery path with a constrained service-host fallback for Google APIs whose documents are absent from the central Discovery Directory.
openclaw/gogcli · #1049
Google API compatibility fix
Generic gogcli commands can now resolve APIs such as Meet v2 when their Discovery document exists only on the service host.
Problem
`gog api describe` and `gog api call` stopped at a central Directory 404 for APIs such as Meet v2, even though Google publishes a valid Discovery document from the API's own service host. Users otherwise needed brittle base-URL overrides to access methods not exposed by first-class commands.
Approach
After a 404 from the implicit central Directory, the client now retries a safely constructed `{api}.googleapis.com/$discovery/rest` URL. The fallback is limited to DNS-safe service names and never applies to explicit base overrides or non-404 responses, preserving existing OAuth request and redirect host validation.
Impact and scope
- Unlocks generic describe and call workflows for service-hosted Google APIs, including Meet v2 conference-record methods.
- Preserves the security boundary by validating service labels and retaining existing OAuth and redirect-host controls.
- Avoids masking server and configuration failures because only the implicit default-directory 404 can trigger fallback.
Validation
- Added regression coverage for fallback success, unsafe names, explicit overrides, non-404 responses, and request construction.
- Passed focused Go tests, `make ci`, credential-free live Meet v2 discovery, dry-run URL verification, and all upstream Linux, macOS, and Windows checks.
- The authored implementation and GitHub-verified merge commit credit Goutam Adwant; the merge closed GH-1048 and included maintainer documentation updates.